mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
change(build): Use integrated assembler with Clang for RISCV chips
This commit is contained in:
parent
64203d1403
commit
9ca231e76e
@ -156,11 +156,12 @@ build_clang_test_apps_esp32s3:
|
||||
extends:
|
||||
- .build_cmake_clang_template
|
||||
variables:
|
||||
# For RISCV clang generates '.linker-options' sections of type 'llvm_linker_options' in asm files.
|
||||
# See (https://llvm.org/docs/Extensions.html#linker-options-section-linker-options).
|
||||
# Binutils gas ignores them with warning.
|
||||
# TODO: LLVM-333, Use integrated assembler.
|
||||
TEST_BUILD_OPTS_EXTRA: "--ignore-warning-str 'Warning: unrecognized section type'"
|
||||
# https://reviews.llvm.org/D90108.
|
||||
# GNU 'as' lets .weak override .globl since binutils-gdb
|
||||
# https://github.com/bminor/binutils-gdb/commit/5ca547dc2399a0a5d9f20626d4bf5547c3ccfddd (1996)
|
||||
# while MC lets the last directive win (PR38921).
|
||||
# For RISCV chips we use integrated assembler by default, so suppress this warning to pass CI pipeline.
|
||||
TEST_BUILD_OPTS_EXTRA: "--ignore-warning-str 'changed binding to STB_WEAK'"
|
||||
|
||||
build_clang_test_apps_esp32c3:
|
||||
extends:
|
||||
|
@ -441,7 +441,7 @@ rtos_current_tcb:
|
||||
lw a0, pxCurrentTCBs
|
||||
#endif /* ( configNUM_CORES > 1 ) */
|
||||
ret
|
||||
.size, .-rtos_current_tcb
|
||||
.size rtos_current_tcb, .-rtos_current_tcb
|
||||
|
||||
|
||||
/**
|
||||
|
@ -21,7 +21,14 @@
|
||||
|
||||
#if ( SOC_CPU_COPROC_NUM > 0 )
|
||||
/* Targets with coprocessors present a special CSR to get Illegal Instruction exception reason */
|
||||
#ifdef __clang__
|
||||
/* Clang does not support constant declared via `equ` as operand for csrrw
|
||||
* TODO: LLVM-369
|
||||
*/
|
||||
#define EXT_ILL_CSR 0x7F0
|
||||
#else
|
||||
.equ EXT_ILL_CSR, 0x7F0
|
||||
#endif
|
||||
|
||||
/* EXT_ILL CSR reasons are stored as follows:
|
||||
* - Bit 0: FPU core instruction (Load/Store instructions NOT concerned)
|
||||
@ -167,7 +174,6 @@ _panic_handler:
|
||||
la ra, _return_from_exception
|
||||
/* EXT_ILL CSR should contain the reason for the Illegal Instruction */
|
||||
csrrw a0, EXT_ILL_CSR, zero
|
||||
|
||||
/* Hardware loop cannot be treated lazily, so we should never end here if a HWLP instruction is used */
|
||||
#if SOC_CPU_HAS_PIE
|
||||
/* Check if the PIE bit is set. */
|
||||
|
@ -11,21 +11,21 @@ set(CMAKE_AR llvm-ar)
|
||||
set(CMAKE_RANLIB llvm-ranlib)
|
||||
set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 \
|
||||
${CMAKE_C_FLAGS}"
|
||||
UNIQ_CMAKE_C_FLAGS)
|
||||
set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}"
|
||||
CACHE STRING "C Compiler Base Flags"
|
||||
FORCE)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 \
|
||||
${CMAKE_CXX_FLAGS}"
|
||||
UNIQ_CMAKE_CXX_FLAGS)
|
||||
set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}"
|
||||
CACHE STRING "C++ Compiler Base Flags"
|
||||
FORCE)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 \
|
||||
${CMAKE_ASM_FLAGS}"
|
||||
UNIQ_CMAKE_ASM_FLAGS)
|
||||
set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}"
|
||||
|
@ -11,21 +11,21 @@ set(CMAKE_AR llvm-ar)
|
||||
set(CMAKE_RANLIB llvm-ranlib)
|
||||
set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 \
|
||||
${CMAKE_C_FLAGS}"
|
||||
UNIQ_CMAKE_C_FLAGS)
|
||||
set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}"
|
||||
CACHE STRING "C Compiler Base Flags"
|
||||
FORCE)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 \
|
||||
${CMAKE_CXX_FLAGS}"
|
||||
UNIQ_CMAKE_CXX_FLAGS)
|
||||
set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}"
|
||||
CACHE STRING "C++ Compiler Base Flags"
|
||||
FORCE)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 \
|
||||
${CMAKE_ASM_FLAGS}"
|
||||
UNIQ_CMAKE_ASM_FLAGS)
|
||||
set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}"
|
||||
|
@ -11,21 +11,21 @@ set(CMAKE_AR llvm-ar)
|
||||
set(CMAKE_RANLIB llvm-ranlib)
|
||||
set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 \
|
||||
${CMAKE_C_FLAGS}"
|
||||
UNIQ_CMAKE_C_FLAGS)
|
||||
set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}"
|
||||
CACHE STRING "C Compiler Base Flags"
|
||||
FORCE)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 \
|
||||
${CMAKE_CXX_FLAGS}"
|
||||
UNIQ_CMAKE_CXX_FLAGS)
|
||||
set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}"
|
||||
CACHE STRING "C++ Compiler Base Flags"
|
||||
FORCE)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 \
|
||||
${CMAKE_ASM_FLAGS}"
|
||||
UNIQ_CMAKE_ASM_FLAGS)
|
||||
set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}"
|
||||
|
@ -11,21 +11,21 @@ set(CMAKE_AR llvm-ar)
|
||||
set(CMAKE_RANLIB llvm-ranlib)
|
||||
set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 \
|
||||
${CMAKE_C_FLAGS}"
|
||||
UNIQ_CMAKE_C_FLAGS)
|
||||
set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}"
|
||||
CACHE STRING "C Compiler Base Flags"
|
||||
FORCE)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 \
|
||||
${CMAKE_CXX_FLAGS}"
|
||||
UNIQ_CMAKE_CXX_FLAGS)
|
||||
set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}"
|
||||
CACHE STRING "C++ Compiler Base Flags"
|
||||
FORCE)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 \
|
||||
${CMAKE_ASM_FLAGS}"
|
||||
UNIQ_CMAKE_ASM_FLAGS)
|
||||
set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}"
|
||||
|
@ -11,21 +11,21 @@ set(CMAKE_AR llvm-ar)
|
||||
set(CMAKE_RANLIB llvm-ranlib)
|
||||
set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 \
|
||||
${CMAKE_C_FLAGS}"
|
||||
UNIQ_CMAKE_C_FLAGS)
|
||||
set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}"
|
||||
CACHE STRING "C Compiler Base Flags"
|
||||
FORCE)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 \
|
||||
${CMAKE_CXX_FLAGS}"
|
||||
UNIQ_CMAKE_CXX_FLAGS)
|
||||
set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}"
|
||||
CACHE STRING "C++ Compiler Base Flags"
|
||||
FORCE)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imac_zicsr_zifencei -mabi=ilp32 \
|
||||
${CMAKE_ASM_FLAGS}"
|
||||
UNIQ_CMAKE_ASM_FLAGS)
|
||||
set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}"
|
||||
|
@ -11,21 +11,21 @@ set(CMAKE_AR llvm-ar)
|
||||
set(CMAKE_RANLIB llvm-ranlib)
|
||||
set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 \
|
||||
${CMAKE_C_FLAGS}"
|
||||
UNIQ_CMAKE_C_FLAGS)
|
||||
set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}"
|
||||
CACHE STRING "C Compiler Base Flags"
|
||||
FORCE)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 \
|
||||
${CMAKE_CXX_FLAGS}"
|
||||
UNIQ_CMAKE_CXX_FLAGS)
|
||||
set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}"
|
||||
CACHE STRING "C++ Compiler Base Flags"
|
||||
FORCE)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 \
|
||||
${CMAKE_ASM_FLAGS}"
|
||||
UNIQ_CMAKE_ASM_FLAGS)
|
||||
set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}"
|
||||
|
@ -11,21 +11,21 @@ set(CMAKE_AR llvm-ar)
|
||||
set(CMAKE_RANLIB llvm-ranlib)
|
||||
set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 \
|
||||
${CMAKE_C_FLAGS}"
|
||||
UNIQ_CMAKE_C_FLAGS)
|
||||
set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}"
|
||||
CACHE STRING "C Compiler Base Flags"
|
||||
FORCE)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 \
|
||||
${CMAKE_CXX_FLAGS}"
|
||||
UNIQ_CMAKE_CXX_FLAGS)
|
||||
set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}"
|
||||
CACHE STRING "C++ Compiler Base Flags"
|
||||
FORCE)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imc_zicsr_zifencei -mabi=ilp32 \
|
||||
${CMAKE_ASM_FLAGS}"
|
||||
UNIQ_CMAKE_ASM_FLAGS)
|
||||
set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}"
|
||||
|
@ -11,21 +11,21 @@ set(CMAKE_AR llvm-ar)
|
||||
set(CMAKE_RANLIB llvm-ranlib)
|
||||
set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imafc_zicsr_zifencei -mabi=ilp32f -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imafc_zicsr_zifencei -mabi=ilp32f \
|
||||
${CMAKE_C_FLAGS}"
|
||||
UNIQ_CMAKE_C_FLAGS)
|
||||
set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}"
|
||||
CACHE STRING "C Compiler Base Flags"
|
||||
FORCE)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imafc_zicsr_zifencei -mabi=ilp32f -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imafc_zicsr_zifencei -mabi=ilp32f \
|
||||
${CMAKE_CXX_FLAGS}"
|
||||
UNIQ_CMAKE_CXX_FLAGS)
|
||||
set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}"
|
||||
CACHE STRING "C++ Compiler Base Flags"
|
||||
FORCE)
|
||||
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imafc_zicsr_zifencei -mabi=ilp32f -no-integrated-as \
|
||||
remove_duplicated_flags("--target=riscv32-esp-elf -march=rv32imafc_zicsr_zifencei -mabi=ilp32f \
|
||||
${CMAKE_ASM_FLAGS}"
|
||||
UNIQ_CMAKE_ASM_FLAGS)
|
||||
set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user