Fix gcc_get_lib_location()

Error checking in gcc_get_lib_location() is invalid. GCC will not
return an error if the specified file cannot be fund, but will return
the filename without PATH. gcc_get_lib_location() was not acting
according to the above behavior and failures were silently ignored.
This change adapts the function to GCC's behavior and makes the
function correctly detect error conditions.

Change-Id: I5337cf01bc1190fa5b3106a3e93e4428ae7be236
Signed-off-by: Gyorgy Szing <Gyorgy.Szing@arm.com>
diff --git a/tools/cmake/compiler/GCC.cmake b/tools/cmake/compiler/GCC.cmake
index fcb40af..33200a1 100644
--- a/tools/cmake/compiler/GCC.cmake
+++ b/tools/cmake/compiler/GCC.cmake
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2019-2021, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2019-2022, Arm Limited and Contributors. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -275,7 +275,12 @@
 		)
 
 	if(_GCC_ERROR_CODE GREATER 0)
-		message(WARNING "GCC (${CMAKE_C_COMPILER}) invocation failed, can not determine location of library ${MY_LIBRARY_NAME}.")
+		message(WARNING "GCC (${CMAKE_C_COMPILER}) invocation failed, cannot determine location of library \"${MY_LIBRARY_NAME}\".")
+		set(_RES "${LIBRARY_NAME}-NOTFOUND")
+	endif()
+
+	if (NOT IS_ABSOLUTE "${_RES}")
+		message(WARNING "GCC (${CMAKE_C_COMPILER}) failed to return the location of file \"${MY_LIBRARY_NAME}\".")
 		set(_RES "${LIBRARY_NAME}-NOTFOUND")
 	endif()