Fix compiler prefix extraction in newlib external

Change the regex based solution to handle arbitrary number of parts in
the compiler prefix. The previous regex only allowed triplets which
caused problems with compilers like aarch64-none-linux-gnu-gcc.

Signed-off-by: Imre Kis <imre.kis@arm.com>
Change-Id: I55247c0fd5223728d08c8537a16c456398dd2bd1
diff --git a/external/newlib/newlib.cmake b/external/newlib/newlib.cmake
index 116c8a6..0e3119b 100644
--- a/external/newlib/newlib.cmake
+++ b/external/newlib/newlib.cmake
@@ -30,7 +30,7 @@
 # Extracting compiler prefix without the trailing hyphen from the C compiler name
 get_filename_component(COMPILER_PATH ${CMAKE_C_COMPILER} DIRECTORY)
 get_filename_component(COMPILER_NAME ${CMAKE_C_COMPILER} NAME)
-string(REGEX REPLACE "([^-]+-[^-]+-[^-]+).*" "\\1" COMPILER_PREFIX ${COMPILER_NAME})
+string(REGEX REPLACE "(.*)-[^-]+$" "\\1" COMPILER_PREFIX ${COMPILER_NAME})
 
 find_library(NEWLIB_LIBC_PATH
 				NAMES libc.a c.a libc.lib c.lib