Build: Set proper response file flag for linkers
To avoid exceeding the command line length limitation, a linker supports
extracting parameters from a file instead of processing a long parameter
list in the command prompt. CMake puts linker parameters in a response
file (typically named as 'objects1.rsp') for linker if there are a lot
of parameters to be processed, then assign linker specified flags for
the linker to extract parameter from this file. CMake applies GNU 'ld'
option '@' as default flag if the flag is not set precisely for a
linker, which leads to potential linker error while using ARMCLANG:
Fatal error: L6002U: Could not open file
@CMakeFiles/tfm_s.dir/objects1.rsp: No such file or directory
Precisely set response file extracting flag for each linker to fix this
problem: '@' for 'GNUARM' and '--via=' for 'ARMCLANG'.
Change-Id: If2ce6644c16aafd0d8c7d8db01e42548ec81825e
diff --git a/cmake/Compiler/GNUARM.cmake b/cmake/Compiler/GNUARM.cmake
index 6305436..e0aec56 100644
--- a/cmake/Compiler/GNUARM.cmake
+++ b/cmake/Compiler/GNUARM.cmake
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2017-2018, Arm Limited. All rights reserved.
+# Copyright (c) 2017-2019, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -38,6 +38,8 @@
set(CMAKE_STATIC_LIBRARY_PREFIX_${lang} "")
set(CMAKE_STATIC_LIBRARY_SUFFIX_${lang} ".a")
+ set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "@")
+
set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_LINKER> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> -o <TARGET> -Xlinker -Map=<TARGET_BASE>.map")
set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_AR> rsc <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")