aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorDavid Hu <david.hu@arm.com>2020-01-10 17:16:26 +0800
committerDavid Hu <david.hu@arm.com>2020-01-13 09:47:54 +0800
commit7ffe5b49c5694dea47a545f62442fd6076d26c53 (patch)
treedd3ba7be1cd9fe2d2adfba40f36a4e62188deea8 /cmake
parent47ecbf04561876f4ae94705c086519654be07422 (diff)
downloadtrusted-firmware-m-7ffe5b49c5694dea47a545f62442fd6076d26c53.tar.gz
Build: Fix arch type of Cortex-M0plus in GNUARM
The arch type of Cortex-M0plus should be "armv6s-m" instead of "armv6-m" in GNU Arm embedded toolchain. Otherwise, compiling will fail because "armv6-m" type doesn't support SVC. Fix the arch type values in GNUARM cmake files. Add an arch type string "ARMv6S-M" for Cortex-M0plus in GNUARM. Because Armclang doesn't have a dedicated flag as "armv6s-m", two strings "ARMv6-M" and "ARMv6S-M" exist and stand for Cortex-M0plus arch type in Armclang and GNUARM respectively. Change-Id: I59e9b9837012fb8dbbae59beacfd6cb293548747 Signed-off-by: David Hu <david.hu@arm.com>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Common/CompilerGNUARM63.cmake14
-rw-r--r--cmake/Common/CompilerGNUARM73.cmake14
-rw-r--r--cmake/Common/CompilerGNUARM83.cmake14
3 files changed, 21 insertions, 21 deletions
diff --git a/cmake/Common/CompilerGNUARM63.cmake b/cmake/Common/CompilerGNUARM63.cmake
index 2d3d05193..affeabb58 100644
--- a/cmake/Common/CompilerGNUARM63.cmake
+++ b/cmake/Common/CompilerGNUARM63.cmake
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2017-2019, Arm Limited. All rights reserved.
+# Copyright (c) 2017-2020, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -30,11 +30,11 @@ elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv7-M")
string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
-elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv6-M")
- string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv6-m")
- string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv6-m")
- string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "-march=" VAL "-march=armv6-m")
- string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "-march=" VAL "-march=armv6-m")
+elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv6S-M")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv6s-m")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv6s-m")
+ string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "-march=" VAL "-march=armv6s-m")
+ string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "-march=" VAL "-march=armv6s-m")
else()
message(FATAL_ERROR "Unknown or unsupported ARM cpu architecture setting.")
endif()
@@ -69,7 +69,7 @@ if(NOT DEFINED ARM_CPU_ARCHITECTURE)
string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m0plus")
string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=Cortex-M0plus")
string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=Cortex-M0plus")
- set(ARM_CPU_ARCHITECTURE "ARMv6-M")
+ set(ARM_CPU_ARCHITECTURE "ARMv6S-M")
else()
message(FATAL_ERROR "Unknown ARM cpu setting.")
endif()
diff --git a/cmake/Common/CompilerGNUARM73.cmake b/cmake/Common/CompilerGNUARM73.cmake
index 861e32928..37b94ae33 100644
--- a/cmake/Common/CompilerGNUARM73.cmake
+++ b/cmake/Common/CompilerGNUARM73.cmake
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+# Copyright (c) 2018-2020, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -30,11 +30,11 @@ elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv7-M")
string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
-elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv6-M")
- string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv6-m")
- string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv6-m")
- string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "-march=" VAL "-march=armv6-m")
- string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "-march=" VAL "-march=armv6-m")
+elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv6S-M")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv6s-m")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv6s-m")
+ string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "-march=" VAL "-march=armv6s-m")
+ string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "-march=" VAL "-march=armv6s-m")
else()
message(FATAL_ERROR "Unknown or unsupported ARM cpu architecture setting.")
endif()
@@ -69,7 +69,7 @@ if(NOT DEFINED ARM_CPU_ARCHITECTURE)
string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m0plus")
string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=Cortex-M0plus")
string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=Cortex-M0plus")
- set(ARM_CPU_ARCHITECTURE "ARMv6-M")
+ set(ARM_CPU_ARCHITECTURE "ARMv6S-M")
else()
message(FATAL_ERROR "Unknown ARM cpu setting.")
endif()
diff --git a/cmake/Common/CompilerGNUARM83.cmake b/cmake/Common/CompilerGNUARM83.cmake
index 2b973e525..57007a4f4 100644
--- a/cmake/Common/CompilerGNUARM83.cmake
+++ b/cmake/Common/CompilerGNUARM83.cmake
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2019, Arm Limited. All rights reserved.
+# Copyright (c) 2019-2020, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -30,11 +30,11 @@ elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv7-M")
string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
-elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv6-M")
- string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv6-m")
- string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv6-m")
- string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "-march=" VAL "-march=armv6-m")
- string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "-march=" VAL "-march=armv6-m")
+elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv6S-M")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv6s-m")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv6s-m")
+ string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "-march=" VAL "-march=armv6s-m")
+ string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "-march=" VAL "-march=armv6s-m")
else()
message(FATAL_ERROR "Unknown or unsupported ARM cpu architecture setting.")
endif()
@@ -69,7 +69,7 @@ if(NOT DEFINED ARM_CPU_ARCHITECTURE)
string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m0plus")
string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=Cortex-m0plus")
string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=Cortex-m0plus")
- set(ARM_CPU_ARCHITECTURE "ARMv6-M")
+ set(ARM_CPU_ARCHITECTURE "ARMv6S-M")
else()
message(FATAL_ERROR "Unknown ARM cpu setting.")
endif()