diff options
author | Raef Coles <raef.coles@arm.com> | 2020-11-06 10:01:44 +0000 |
---|---|---|
committer | David Hu <david.hu@arm.com> | 2020-11-09 09:46:54 +0000 |
commit | caa92d6fc588f5fbd8ed90c35c8f94aac2fd5906 (patch) | |
tree | b1e76e3a8ef7c73cab782edee568477650351910 /toolchain_ARMCLANG.cmake | |
parent | d1c9363343cf034f513013dd2b370d648b13d04d (diff) | |
download | trusted-firmware-m-caa92d6fc588f5fbd8ed90c35c8f94aac2fd5906.tar.gz |
Build: Alter handling of --cpu flag for armlink
To be compliant with correct syntax, and better handle cases related to
the new armclang support in cmake 3.18.
Change-Id: I21535cf3658ab22cd5f7d2714bf1b12e25eed075
Signed-off-by: Raef Coles <raef.coles@arm.com>
Diffstat (limited to 'toolchain_ARMCLANG.cmake')
-rw-r--r-- | toolchain_ARMCLANG.cmake | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/toolchain_ARMCLANG.cmake b/toolchain_ARMCLANG.cmake index 9e8faf06b6..003fe99b99 100644 --- a/toolchain_ARMCLANG.cmake +++ b/toolchain_ARMCLANG.cmake @@ -121,10 +121,14 @@ macro(tfm_toolchain_reload_compiler) set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS_INIT}) set(CMAKE_ASM_FLAGS ${CMAKE_ASM_FLAGS_INIT}) - # But armlink doesn't support this +dsp syntax, so take the cpu flag and - # throw away the plus and everything after. - string(REGEX REPLACE "\\+nodsp" ".no_dsp" CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS}") - string(REGEX REPLACE "\\+nodsp" ".no_dsp" CMAKE_ASM_LINK_FLAGS "${CMAKE_ASM_LINK_FLAGS}") + set(CMAKE_C_LINK_FLAGS "--cpu=${CMAKE_SYSTEM_PROCESSOR}") + set(CMAKE_ASM_LINK_FLAGS "--cpu=${CMAKE_SYSTEM_PROCESSOR}") + # But armlink doesn't support this +dsp syntax + string(REGEX REPLACE "\\+nodsp" "" CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS}") + string(REGEX REPLACE "\\+nodsp" "" CMAKE_ASM_LINK_FLAGS "${CMAKE_ASM_LINK_FLAGS}") + # And uses different syntax for +nofp + string(REGEX REPLACE "\\+nofp" ".no_fp" CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS}") + string(REGEX REPLACE "\\+nofp" ".no_fp" CMAKE_ASM_LINK_FLAGS "${CMAKE_ASM_LINK_FLAGS}") # Workaround for issues with --depend-single-line with armasm and Ninja if (CMAKE_GENERATOR STREQUAL "Ninja") |