Skip to content

Commit db189ba

Browse files
committed
CMake: Correct ARM toolchain MCU core flags
Some armasm flags are passed to the ASM whilst we actually use armclang to invoke it. This causes build failures as armclang is not compatible with armasm flags. This commit passes the same flags to all tools in the chain.
1 parent 83c18dd commit db189ba

15 files changed

+15
-105
lines changed

tools/cmake/cores/Cortex-A9.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
1111
"-mno-unaligned-access"
1212
)
1313
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
14-
list(APPEND c_cxx_compile_options
14+
list(APPEND common_options
1515
"-mcpu=cortex-a9"
1616
)
17-
list(APPEND asm_compile_options
18-
"-mcpu=Cortex-A9"
19-
)
20-
list(APPEND link_options
21-
"--cpu=Cortex-A9"
22-
)
2317
endif()
2418

2519
function(mbed_set_cpu_core_definitions target)

tools/cmake/cores/Cortex-M0+.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
88
"-mcpu=cortex-m0plus"
99
)
1010
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
11-
list(APPEND c_cxx_compile_options
11+
list(APPEND common_options
1212
"-mcpu=cortex-m0plus"
1313
)
14-
list(APPEND asm_compile_options
15-
"-mcpu=Cortex-M0plus"
16-
)
17-
list(APPEND link_options
18-
"--cpu=Cortex-M0plus"
19-
)
2014
endif()
2115

2216
function(mbed_set_cpu_core_definitions target)

tools/cmake/cores/Cortex-M0.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
88
"-mcpu=cortex-m0"
99
)
1010
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
11-
list(APPEND c_cxx_compile_options
11+
list(APPEND common_options
1212
"-mcpu=cortex-m0"
1313
)
14-
list(APPEND asm_compile_options
15-
"-mcpu=Cortex-M0"
16-
)
17-
list(APPEND link_options
18-
"--cpu=Cortex-M0"
19-
)
2014
endif()
2115

2216
function(mbed_set_cpu_core_definitions target)

tools/cmake/cores/Cortex-M1.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
77
"-mthumb"
88
)
99
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
10-
list(APPEND c_cxx_compile_options
10+
list(APPEND common_options
1111
"-mcpu=cortex-m1"
1212
)
13-
list(APPEND asm_compile_options
14-
"-mcpu=Cortex-M1"
15-
)
16-
list(APPEND link_options
17-
"--cpu=Cortex-M1"
18-
)
1913
endif()
2014

2115
function(mbed_set_cpu_core_definitions target)

tools/cmake/cores/Cortex-M23-NS.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
77
"-mthumb"
88
)
99
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
10-
list(APPEND c_cxx_compile_options
10+
list(APPEND common_options
1111
"-mcpu=cortex-m23"
1212
)
13-
list(APPEND asm_compile_options
14-
"-mcpu=Cortex-M23"
15-
)
16-
list(APPEND link_options
17-
"--cpu=Cortex-M23"
18-
)
1913
endif()
2014

2115

tools/cmake/cores/Cortex-M23.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
77
"-mthumb"
88
)
99
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
10-
list(APPEND c_cxx_compile_options
10+
list(APPEND common_options
1111
"-mcpu=cortex-m23"
1212
)
13-
list(APPEND asm_compile_options
14-
"-mcpu=Cortex-M23"
15-
)
16-
list(APPEND link_options
17-
"--cpu=Cortex-M23"
18-
)
1913
endif()
2014

2115

tools/cmake/cores/Cortex-M3.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
88
"-mcpu=cortex-m3"
99
)
1010
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
11-
list(APPEND c_cxx_compile_options
11+
list(APPEND common_options
1212
"-mcpu=cortex-m3"
1313
)
14-
list(APPEND asm_compile_options
15-
"-mcpu=Cortex-M3"
16-
)
17-
list(APPEND link_options
18-
"--cpu=Cortex-M3"
19-
)
2014
endif()
2115

2216
function(mbed_set_cpu_core_definitions target)

tools/cmake/cores/Cortex-M33F-NS.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,11 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
1010
"-march=armv8-m.main"
1111
)
1212
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
13-
list(APPEND c_cxx_compile_options
13+
list(APPEND common_options
1414
"-mcpu=cortex-m33+nodsp"
1515
"-mfpu=fpv5-sp-d16"
1616
"-mfloat-abi=hard"
1717
)
18-
list(APPEND asm_compile_options
19-
"-mcpu=Cortex-M33.no_dsp"
20-
)
21-
list(APPEND link_options
22-
"--cpu=Cortex-M33.no_dsp"
23-
)
2418
endif()
2519

2620

tools/cmake/cores/Cortex-M33F.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,11 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
1010
"-march=armv8-m.main"
1111
)
1212
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
13-
list(APPEND c_cxx_compile_options
13+
list(APPEND common_options
1414
"-mcpu=cortex-m33+nodsp"
1515
"-mfpu=fpv5-sp-d16"
1616
"-mfloat-abi=hard"
1717
)
18-
list(APPEND asm_compile_options
19-
"-mcpu=Cortex-M33.no_dsp"
20-
)
21-
list(APPEND link_options
22-
"--cpu=Cortex-M33.no_dsp"
23-
)
2418
endif()
2519

2620
function(mbed_set_cpu_core_definitions target)

tools/cmake/cores/Cortex-M33FE-NS.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
1010
"-march=armv8-m.main+dsp"
1111
)
1212
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
13-
list(APPEND c_cxx_compile_options
13+
list(APPEND common_options
1414
"-mcpu=cortex-m33"
1515
)
16-
list(APPEND asm_compile_options
17-
"-mcpu=Cortex-M33"
18-
)
19-
list(APPEND link_options
20-
"--cpu=Cortex-M33"
21-
)
2216
endif()
2317

2418
function(mbed_set_cpu_core_definitions target)

0 commit comments

Comments
 (0)