Build: Set object extension to .o in NS toolchain
Change-Id: Ia19b8272d6bab59f038f78ebe5d91f93e46af24b
Signed-off-by: David Hu <david.hu@arm.com>
diff --git a/cmake/install.cmake b/cmake/install.cmake
index cd3d808..a25a64d 100644
--- a/cmake/install.cmake
+++ b/cmake/install.cmake
@@ -159,7 +159,6 @@
DESTINATION ${INSTALL_INTERFACE_SRC_DIR})
endif()
-
##################### Export image signing information #########################
if(BL2)
@@ -260,3 +259,7 @@
configure_file(${CMAKE_SOURCE_DIR}/config/spe_config.cmake.in
${INSTALL_CMAKE_DIR}/spe_config.cmake @ONLY)
+
+# Toolchain utils
+install(FILES cmake/set_extensions.cmake
+ DESTINATION ${INSTALL_CMAKE_DIR})
diff --git a/platform/ns/toolchain_ns_ARMCLANG.cmake b/platform/ns/toolchain_ns_ARMCLANG.cmake
index ea1c88a..66af662 100644
--- a/platform/ns/toolchain_ns_ARMCLANG.cmake
+++ b/platform/ns/toolchain_ns_ARMCLANG.cmake
@@ -23,7 +23,7 @@
# at a particular step in the compiler initialisation. It is used here to
# configure the extensions for object files. Despite the name, it also works
# with the Ninja generator.
-#set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_CURRENT_LIST_DIR}/cmake/set_extensions.cmake)
+set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_CURRENT_LIST_DIR}/set_extensions.cmake)
if(NOT DEFINED CMAKE_OBJCOPY)
set(CMAKE_OBJCOPY ${CROSS_COMPILE}-objcopy CACHE FILEPATH "Path to objcopy")
diff --git a/platform/ns/toolchain_ns_GNUARM.cmake b/platform/ns/toolchain_ns_GNUARM.cmake
index fb2ace9..4f7d066 100644
--- a/platform/ns/toolchain_ns_GNUARM.cmake
+++ b/platform/ns/toolchain_ns_GNUARM.cmake
@@ -30,6 +30,12 @@
# Set compiler ID explicitly as it's not detected at this moment
set(CMAKE_C_COMPILER_ID GNU)
+# This variable name is a bit of a misnomer. The file it is set to is included
+# at a particular step in the compiler initialisation. It is used here to
+# configure the extensions for object files. Despite the name, it also works
+# with the Ninja generator.
+set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_CURRENT_LIST_DIR}/set_extensions.cmake)
+
# CMAKE_C_COMPILER_VERSION is not guaranteed to be defined.
EXECUTE_PROCESS( COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION )