build: Add --longcalls option to clang builds of xtensa targets

This commit adds the --longcalls option to UNIQ_CMAKE_ASM_FLAGS for clang
builds of xtensa targets to prevent "dangerous relocation" errors.
This commit is contained in:
Darian Leung 2023-04-14 19:39:35 +08:00
parent 6587e75251
commit 9509c14510
3 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,7 @@ set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}"
CACHE STRING "C++ Compiler Base Flags"
FORCE)
remove_duplicated_flags("--target=xtensa-esp-elf -mcpu=esp32 ${CMAKE_ASM_FLAGS}"
remove_duplicated_flags("--target=xtensa-esp-elf -mcpu=esp32 -Xassembler --longcalls ${CMAKE_ASM_FLAGS}"
UNIQ_CMAKE_ASM_FLAGS)
set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}"
CACHE STRING "Assembler Base Flags"

View File

@ -24,7 +24,7 @@ set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}"
CACHE STRING "C++ Compiler Base Flags"
FORCE)
remove_duplicated_flags("--target=xtensa-esp-elf -mcpu=esp32s2 ${CMAKE_ASM_FLAGS}"
remove_duplicated_flags("--target=xtensa-esp-elf -mcpu=esp32s2 -Xassembler --longcalls ${CMAKE_ASM_FLAGS}"
UNIQ_CMAKE_ASM_FLAGS)
set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}"
CACHE STRING "Assembler Base Flags"

View File

@ -23,7 +23,7 @@ set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}"
CACHE STRING "C++ Compiler Base Flags"
FORCE)
remove_duplicated_flags("--target=xtensa-esp-elf -mcpu=esp32s3 ${CMAKE_ASM_FLAGS}"
remove_duplicated_flags("--target=xtensa-esp-elf -mcpu=esp32s3 -Xassembler --longcalls ${CMAKE_ASM_FLAGS}"
UNIQ_CMAKE_ASM_FLAGS)
set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}"
CACHE STRING "Assembler Base Flags"