mirror of https://github.com/ARMmbed/mbed-os.git
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.pull/14185/head
parent
83c18dd67c
commit
db189bae6d
|
@ -11,15 +11,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
"-mno-unaligned-access"
|
"-mno-unaligned-access"
|
||||||
)
|
)
|
||||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
list(APPEND c_cxx_compile_options
|
list(APPEND common_options
|
||||||
"-mcpu=cortex-a9"
|
"-mcpu=cortex-a9"
|
||||||
)
|
)
|
||||||
list(APPEND asm_compile_options
|
|
||||||
"-mcpu=Cortex-A9"
|
|
||||||
)
|
|
||||||
list(APPEND link_options
|
|
||||||
"--cpu=Cortex-A9"
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
function(mbed_set_cpu_core_definitions target)
|
function(mbed_set_cpu_core_definitions target)
|
||||||
|
|
|
@ -8,15 +8,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
"-mcpu=cortex-m0plus"
|
"-mcpu=cortex-m0plus"
|
||||||
)
|
)
|
||||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
list(APPEND c_cxx_compile_options
|
list(APPEND common_options
|
||||||
"-mcpu=cortex-m0plus"
|
"-mcpu=cortex-m0plus"
|
||||||
)
|
)
|
||||||
list(APPEND asm_compile_options
|
|
||||||
"-mcpu=Cortex-M0plus"
|
|
||||||
)
|
|
||||||
list(APPEND link_options
|
|
||||||
"--cpu=Cortex-M0plus"
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
function(mbed_set_cpu_core_definitions target)
|
function(mbed_set_cpu_core_definitions target)
|
||||||
|
|
|
@ -8,15 +8,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
"-mcpu=cortex-m0"
|
"-mcpu=cortex-m0"
|
||||||
)
|
)
|
||||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
list(APPEND c_cxx_compile_options
|
list(APPEND common_options
|
||||||
"-mcpu=cortex-m0"
|
"-mcpu=cortex-m0"
|
||||||
)
|
)
|
||||||
list(APPEND asm_compile_options
|
|
||||||
"-mcpu=Cortex-M0"
|
|
||||||
)
|
|
||||||
list(APPEND link_options
|
|
||||||
"--cpu=Cortex-M0"
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
function(mbed_set_cpu_core_definitions target)
|
function(mbed_set_cpu_core_definitions target)
|
||||||
|
|
|
@ -7,15 +7,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
"-mthumb"
|
"-mthumb"
|
||||||
)
|
)
|
||||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
list(APPEND c_cxx_compile_options
|
list(APPEND common_options
|
||||||
"-mcpu=cortex-m1"
|
"-mcpu=cortex-m1"
|
||||||
)
|
)
|
||||||
list(APPEND asm_compile_options
|
|
||||||
"-mcpu=Cortex-M1"
|
|
||||||
)
|
|
||||||
list(APPEND link_options
|
|
||||||
"--cpu=Cortex-M1"
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
function(mbed_set_cpu_core_definitions target)
|
function(mbed_set_cpu_core_definitions target)
|
||||||
|
|
|
@ -7,15 +7,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
"-mthumb"
|
"-mthumb"
|
||||||
)
|
)
|
||||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
list(APPEND c_cxx_compile_options
|
list(APPEND common_options
|
||||||
"-mcpu=cortex-m23"
|
"-mcpu=cortex-m23"
|
||||||
)
|
)
|
||||||
list(APPEND asm_compile_options
|
|
||||||
"-mcpu=Cortex-M23"
|
|
||||||
)
|
|
||||||
list(APPEND link_options
|
|
||||||
"--cpu=Cortex-M23"
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,15 +7,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
"-mthumb"
|
"-mthumb"
|
||||||
)
|
)
|
||||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
list(APPEND c_cxx_compile_options
|
list(APPEND common_options
|
||||||
"-mcpu=cortex-m23"
|
"-mcpu=cortex-m23"
|
||||||
)
|
)
|
||||||
list(APPEND asm_compile_options
|
|
||||||
"-mcpu=Cortex-M23"
|
|
||||||
)
|
|
||||||
list(APPEND link_options
|
|
||||||
"--cpu=Cortex-M23"
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,15 +8,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
"-mcpu=cortex-m3"
|
"-mcpu=cortex-m3"
|
||||||
)
|
)
|
||||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
list(APPEND c_cxx_compile_options
|
list(APPEND common_options
|
||||||
"-mcpu=cortex-m3"
|
"-mcpu=cortex-m3"
|
||||||
)
|
)
|
||||||
list(APPEND asm_compile_options
|
|
||||||
"-mcpu=Cortex-M3"
|
|
||||||
)
|
|
||||||
list(APPEND link_options
|
|
||||||
"--cpu=Cortex-M3"
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
function(mbed_set_cpu_core_definitions target)
|
function(mbed_set_cpu_core_definitions target)
|
||||||
|
|
|
@ -10,17 +10,11 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
"-march=armv8-m.main"
|
"-march=armv8-m.main"
|
||||||
)
|
)
|
||||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
list(APPEND c_cxx_compile_options
|
list(APPEND common_options
|
||||||
"-mcpu=cortex-m33+nodsp"
|
"-mcpu=cortex-m33+nodsp"
|
||||||
"-mfpu=fpv5-sp-d16"
|
"-mfpu=fpv5-sp-d16"
|
||||||
"-mfloat-abi=hard"
|
"-mfloat-abi=hard"
|
||||||
)
|
)
|
||||||
list(APPEND asm_compile_options
|
|
||||||
"-mcpu=Cortex-M33.no_dsp"
|
|
||||||
)
|
|
||||||
list(APPEND link_options
|
|
||||||
"--cpu=Cortex-M33.no_dsp"
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,17 +10,11 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
"-march=armv8-m.main"
|
"-march=armv8-m.main"
|
||||||
)
|
)
|
||||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
list(APPEND c_cxx_compile_options
|
list(APPEND common_options
|
||||||
"-mcpu=cortex-m33+nodsp"
|
"-mcpu=cortex-m33+nodsp"
|
||||||
"-mfpu=fpv5-sp-d16"
|
"-mfpu=fpv5-sp-d16"
|
||||||
"-mfloat-abi=hard"
|
"-mfloat-abi=hard"
|
||||||
)
|
)
|
||||||
list(APPEND asm_compile_options
|
|
||||||
"-mcpu=Cortex-M33.no_dsp"
|
|
||||||
)
|
|
||||||
list(APPEND link_options
|
|
||||||
"--cpu=Cortex-M33.no_dsp"
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
function(mbed_set_cpu_core_definitions target)
|
function(mbed_set_cpu_core_definitions target)
|
||||||
|
|
|
@ -10,15 +10,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
"-march=armv8-m.main+dsp"
|
"-march=armv8-m.main+dsp"
|
||||||
)
|
)
|
||||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
list(APPEND c_cxx_compile_options
|
list(APPEND common_options
|
||||||
"-mcpu=cortex-m33"
|
"-mcpu=cortex-m33"
|
||||||
)
|
)
|
||||||
list(APPEND asm_compile_options
|
|
||||||
"-mcpu=Cortex-M33"
|
|
||||||
)
|
|
||||||
list(APPEND link_options
|
|
||||||
"--cpu=Cortex-M33"
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
function(mbed_set_cpu_core_definitions target)
|
function(mbed_set_cpu_core_definitions target)
|
||||||
|
|
|
@ -10,15 +10,9 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
"-march=armv8-m.main+dsp"
|
"-march=armv8-m.main+dsp"
|
||||||
)
|
)
|
||||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
list(APPEND c_cxx_compile_options
|
list(APPEND common_options
|
||||||
"-mcpu=cortex-m33"
|
"-mcpu=cortex-m33"
|
||||||
)
|
)
|
||||||
list(APPEND asm_compile_options
|
|
||||||
"-mcpu=Cortex-M33"
|
|
||||||
)
|
|
||||||
list(APPEND link_options
|
|
||||||
"--cpu=Cortex-M33"
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
function(mbed_set_cpu_core_definitions target)
|
function(mbed_set_cpu_core_definitions target)
|
||||||
|
|
|
@ -8,16 +8,10 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
"-mcpu=cortex-m4"
|
"-mcpu=cortex-m4"
|
||||||
)
|
)
|
||||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
list(APPEND c_cxx_compile_options
|
list(APPEND common_options
|
||||||
"-mcpu=cortex-m4"
|
"-mcpu=cortex-m4"
|
||||||
"-mfpu=none"
|
"-mfpu=none"
|
||||||
)
|
)
|
||||||
list(APPEND asm_compile_options
|
|
||||||
"-mcpu=Cortex-M4.no_fp"
|
|
||||||
)
|
|
||||||
list(APPEND link_options
|
|
||||||
"--cpu=Cortex-M4.no_fp"
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
function(mbed_set_cpu_core_definitions target)
|
function(mbed_set_cpu_core_definitions target)
|
||||||
|
|
|
@ -10,17 +10,11 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
"-mfloat-abi=softfp"
|
"-mfloat-abi=softfp"
|
||||||
)
|
)
|
||||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
list(APPEND c_cxx_compile_options
|
list(APPEND common_options
|
||||||
"-mcpu=cortex-m4"
|
"-mcpu=cortex-m4"
|
||||||
"-mfpu=fpv4-sp-d16"
|
"-mfpu=fpv4-sp-d16"
|
||||||
"-mfloat-abi=hard"
|
"-mfloat-abi=hard"
|
||||||
)
|
)
|
||||||
list(APPEND asm_compile_options
|
|
||||||
"-mcpu=Cortex-M4"
|
|
||||||
)
|
|
||||||
list(APPEND link_options
|
|
||||||
"--cpu=Cortex-M4"
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
function(mbed_set_cpu_core_definitions target)
|
function(mbed_set_cpu_core_definitions target)
|
||||||
|
|
|
@ -8,16 +8,10 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
"-mcpu=cortex-m7"
|
"-mcpu=cortex-m7"
|
||||||
)
|
)
|
||||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
list(APPEND c_cxx_compile_options
|
list(APPEND common_options
|
||||||
"-mcpu=cortex-m7"
|
"-mcpu=cortex-m7"
|
||||||
"-mfpu=none"
|
"-mfpu=none"
|
||||||
)
|
)
|
||||||
list(APPEND asm_compile_options
|
|
||||||
"-mcpu=Cortex-M7.no_fp"
|
|
||||||
)
|
|
||||||
list(APPEND link_options
|
|
||||||
"--cpu=Cortex-M7.no_fp"
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
function(mbed_set_cpu_core_definitions target)
|
function(mbed_set_cpu_core_definitions target)
|
||||||
|
|
|
@ -10,17 +10,11 @@ if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||||
"-mcpu=cortex-m7"
|
"-mcpu=cortex-m7"
|
||||||
)
|
)
|
||||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||||
list(APPEND c_cxx_compile_options
|
list(APPEND common_options
|
||||||
"-mcpu=cortex-m7"
|
"-mcpu=cortex-m7"
|
||||||
"-mfpu=fpv5-d16"
|
"-mfpu=fpv5-d16"
|
||||||
"-mfloat-abi=hard"
|
"-mfloat-abi=hard"
|
||||||
)
|
)
|
||||||
list(APPEND asm_compile_options
|
|
||||||
"-mcpu=Cortex-M7"
|
|
||||||
)
|
|
||||||
list(APPEND link_options
|
|
||||||
"--cpu=Cortex-M7"
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
function(mbed_set_cpu_core_definitions target)
|
function(mbed_set_cpu_core_definitions target)
|
||||||
|
|
Loading…
Reference in New Issue