arch/arm32v8m/cmake: Fix clang's error in specifying cfg and target
1. -target should be in front, otherwise clang will not be able to find the corresponding libgcc.a 2. When using clang++ compiler to link, you also need to specify the corresponding arch, otherwise ld.lld will report an error due to arch mismatch. Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
This commit is contained in:
parent
be0057c928
commit
d3dd43cb59
1 changed files with 5 additions and 2 deletions
|
|
@ -54,11 +54,14 @@ if(TOOLCHAIN_CLANG_CONFIG)
|
|||
set(TOOLCHAIN_CLANG_CONFIG ${TOOLCHAIN_CLANG_CONFIG}_nosys)
|
||||
elseif(CLANGVER STRGREATER_EQUAL "17.0")
|
||||
set(TOOLCHAIN_CLANG_OPTION -target)
|
||||
add_compile_options(--target=arm-none-eabi)
|
||||
set(TOOLCHAIN_CLANG_TARGET --target=arm-none-eabi)
|
||||
else()
|
||||
set(TOOLCHAIN_CLANG_OPTION --config)
|
||||
endif()
|
||||
add_compile_options(${TOOLCHAIN_CLANG_OPTION} ${TOOLCHAIN_CLANG_CONFIG}.cfg)
|
||||
add_compile_options(${TOOLCHAIN_CLANG_OPTION} ${TOOLCHAIN_CLANG_CONFIG}.cfg
|
||||
${TOOLCHAIN_CLANG_TARGET})
|
||||
add_link_options(${TOOLCHAIN_CLANG_OPTION} ${TOOLCHAIN_CLANG_CONFIG}.cfg
|
||||
${TOOLCHAIN_CLANG_TARGET})
|
||||
endif()
|
||||
|
||||
# override the ARCHIVE command
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue