Merge branch 'feature/update-esp-clang-to-esp-18.1.2_20240815' into 'master'
Some checks are pending
docker / docker (push) Waiting to run

feat(tools): update esp-clang version to esp-18.1.2_20240912

Closes LLVM-333

See merge request espressif/esp-idf!32895
This commit is contained in:
Alexey Gerenkov 2024-09-19 03:49:46 +08:00
commit 81f4ef73c3
15 changed files with 71 additions and 61 deletions

View File

@ -156,11 +156,12 @@ build_clang_test_apps_esp32s3:
extends: extends:
- .build_cmake_clang_template - .build_cmake_clang_template
variables: variables:
# For RISCV clang generates '.linker-options' sections of type 'llvm_linker_options' in asm files. # https://reviews.llvm.org/D90108.
# See (https://llvm.org/docs/Extensions.html#linker-options-section-linker-options). # GNU 'as' lets .weak override .globl since binutils-gdb
# Binutils gas ignores them with warning. # https://github.com/bminor/binutils-gdb/commit/5ca547dc2399a0a5d9f20626d4bf5547c3ccfddd (1996)
# TODO: LLVM-333, Use integrated assembler. # while MC lets the last directive win (PR38921).
TEST_BUILD_OPTS_EXTRA: "--ignore-warning-str 'Warning: unrecognized section type'" # 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: build_clang_test_apps_esp32c3:
extends: extends:

View File

@ -134,8 +134,8 @@ static void s_reserve_irom_region(mem_region_t *hw_mem_regions, int region_nums)
* - Now IBUS addresses (between `_instruction_reserved_start` and `_instruction_reserved_end`) are consecutive on all chips, * - Now IBUS addresses (between `_instruction_reserved_start` and `_instruction_reserved_end`) are consecutive on all chips,
* we strongly rely on this to calculate the .text length * we strongly rely on this to calculate the .text length
*/ */
extern int _instruction_reserved_start; extern char _instruction_reserved_start;
extern int _instruction_reserved_end; extern char _instruction_reserved_end;
size_t irom_len_to_reserve = (uint32_t)&_instruction_reserved_end - (uint32_t)&_instruction_reserved_start; size_t irom_len_to_reserve = (uint32_t)&_instruction_reserved_end - (uint32_t)&_instruction_reserved_start;
assert((mmu_ll_vaddr_to_laddr((uint32_t)&_instruction_reserved_end) - mmu_ll_vaddr_to_laddr((uint32_t)&_instruction_reserved_start)) == irom_len_to_reserve); assert((mmu_ll_vaddr_to_laddr((uint32_t)&_instruction_reserved_end) - mmu_ll_vaddr_to_laddr((uint32_t)&_instruction_reserved_start)) == irom_len_to_reserve);
@ -162,8 +162,8 @@ static void s_reserve_drom_region(mem_region_t *hw_mem_regions, int region_nums)
/** /**
* Similarly, we follow the way how 1st bootloader load flash .rodata: * Similarly, we follow the way how 1st bootloader load flash .rodata:
*/ */
extern int _rodata_reserved_start; extern char _rodata_reserved_start;
extern int _rodata_reserved_end; extern char _rodata_reserved_end;
size_t drom_len_to_reserve = (uint32_t)&_rodata_reserved_end - (uint32_t)&_rodata_reserved_start; size_t drom_len_to_reserve = (uint32_t)&_rodata_reserved_end - (uint32_t)&_rodata_reserved_start;
assert((mmu_ll_vaddr_to_laddr((uint32_t)&_rodata_reserved_end) - mmu_ll_vaddr_to_laddr((uint32_t)&_rodata_reserved_start)) == drom_len_to_reserve); assert((mmu_ll_vaddr_to_laddr((uint32_t)&_rodata_reserved_end) - mmu_ll_vaddr_to_laddr((uint32_t)&_rodata_reserved_start)) == drom_len_to_reserve);

View File

@ -441,7 +441,7 @@ rtos_current_tcb:
lw a0, pxCurrentTCBs lw a0, pxCurrentTCBs
#endif /* ( configNUM_CORES > 1 ) */ #endif /* ( configNUM_CORES > 1 ) */
ret ret
.size, .-rtos_current_tcb .size rtos_current_tcb, .-rtos_current_tcb
/** /**

View File

@ -21,7 +21,14 @@
#if ( SOC_CPU_COPROC_NUM > 0 ) #if ( SOC_CPU_COPROC_NUM > 0 )
/* Targets with coprocessors present a special CSR to get Illegal Instruction exception reason */ /* 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 .equ EXT_ILL_CSR, 0x7F0
#endif
/* EXT_ILL CSR reasons are stored as follows: /* EXT_ILL CSR reasons are stored as follows:
* - Bit 0: FPU core instruction (Load/Store instructions NOT concerned) * - Bit 0: FPU core instruction (Load/Store instructions NOT concerned)
@ -167,7 +174,6 @@ _panic_handler:
la ra, _return_from_exception la ra, _return_from_exception
/* EXT_ILL CSR should contain the reason for the Illegal Instruction */ /* EXT_ILL CSR should contain the reason for the Illegal Instruction */
csrrw a0, EXT_ILL_CSR, zero csrrw a0, EXT_ILL_CSR, zero
/* Hardware loop cannot be treated lazily, so we should never end here if a HWLP instruction is used */ /* Hardware loop cannot be treated lazily, so we should never end here if a HWLP instruction is used */
#if SOC_CPU_HAS_PIE #if SOC_CPU_HAS_PIE
/* Check if the PIE bit is set. */ /* Check if the PIE bit is set. */

View File

@ -174,9 +174,7 @@
#define SOC_CPU_HAS_FPU_EXT_ILL_BUG 1 // EXT_ILL CSR doesn't support FLW/FSW #define SOC_CPU_HAS_FPU_EXT_ILL_BUG 1 // EXT_ILL CSR doesn't support FLW/FSW
#define SOC_CPU_HAS_HWLOOP 1 #define SOC_CPU_HAS_HWLOOP 1
/* PIE coprocessor assembly is only supported with GCC compiler */ /* PIE coprocessor assembly is only supported with GCC compiler */
#ifndef __clang__
#define SOC_CPU_HAS_PIE 1 #define SOC_CPU_HAS_PIE 1
#endif
#define SOC_HP_CPU_HAS_MULTIPLE_CORES 1 // Convenience boolean macro used to determine if a target has multiple cores. #define SOC_HP_CPU_HAS_MULTIPLE_CORES 1 // Convenience boolean macro used to determine if a target has multiple cores.

View File

@ -11,21 +11,21 @@ set(CMAKE_AR llvm-ar)
set(CMAKE_RANLIB llvm-ranlib) set(CMAKE_RANLIB llvm-ranlib)
set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump) 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}" ${CMAKE_C_FLAGS}"
UNIQ_CMAKE_C_FLAGS) UNIQ_CMAKE_C_FLAGS)
set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}"
CACHE STRING "C Compiler Base Flags" CACHE STRING "C Compiler Base Flags"
FORCE) 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}" ${CMAKE_CXX_FLAGS}"
UNIQ_CMAKE_CXX_FLAGS) UNIQ_CMAKE_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}"
CACHE STRING "C++ Compiler Base Flags" CACHE STRING "C++ Compiler Base Flags"
FORCE) 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}" ${CMAKE_ASM_FLAGS}"
UNIQ_CMAKE_ASM_FLAGS) UNIQ_CMAKE_ASM_FLAGS)
set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}" set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}"

View File

@ -11,21 +11,21 @@ set(CMAKE_AR llvm-ar)
set(CMAKE_RANLIB llvm-ranlib) set(CMAKE_RANLIB llvm-ranlib)
set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump) 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}" ${CMAKE_C_FLAGS}"
UNIQ_CMAKE_C_FLAGS) UNIQ_CMAKE_C_FLAGS)
set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}"
CACHE STRING "C Compiler Base Flags" CACHE STRING "C Compiler Base Flags"
FORCE) 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}" ${CMAKE_CXX_FLAGS}"
UNIQ_CMAKE_CXX_FLAGS) UNIQ_CMAKE_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}"
CACHE STRING "C++ Compiler Base Flags" CACHE STRING "C++ Compiler Base Flags"
FORCE) 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}" ${CMAKE_ASM_FLAGS}"
UNIQ_CMAKE_ASM_FLAGS) UNIQ_CMAKE_ASM_FLAGS)
set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}" set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}"

View File

@ -11,21 +11,21 @@ set(CMAKE_AR llvm-ar)
set(CMAKE_RANLIB llvm-ranlib) set(CMAKE_RANLIB llvm-ranlib)
set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump) 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}" ${CMAKE_C_FLAGS}"
UNIQ_CMAKE_C_FLAGS) UNIQ_CMAKE_C_FLAGS)
set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}"
CACHE STRING "C Compiler Base Flags" CACHE STRING "C Compiler Base Flags"
FORCE) 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}" ${CMAKE_CXX_FLAGS}"
UNIQ_CMAKE_CXX_FLAGS) UNIQ_CMAKE_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}"
CACHE STRING "C++ Compiler Base Flags" CACHE STRING "C++ Compiler Base Flags"
FORCE) 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}" ${CMAKE_ASM_FLAGS}"
UNIQ_CMAKE_ASM_FLAGS) UNIQ_CMAKE_ASM_FLAGS)
set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}" set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}"

View File

@ -11,21 +11,21 @@ set(CMAKE_AR llvm-ar)
set(CMAKE_RANLIB llvm-ranlib) set(CMAKE_RANLIB llvm-ranlib)
set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump) 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}" ${CMAKE_C_FLAGS}"
UNIQ_CMAKE_C_FLAGS) UNIQ_CMAKE_C_FLAGS)
set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}"
CACHE STRING "C Compiler Base Flags" CACHE STRING "C Compiler Base Flags"
FORCE) 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}" ${CMAKE_CXX_FLAGS}"
UNIQ_CMAKE_CXX_FLAGS) UNIQ_CMAKE_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}"
CACHE STRING "C++ Compiler Base Flags" CACHE STRING "C++ Compiler Base Flags"
FORCE) 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}" ${CMAKE_ASM_FLAGS}"
UNIQ_CMAKE_ASM_FLAGS) UNIQ_CMAKE_ASM_FLAGS)
set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}" set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}"

View File

@ -11,21 +11,21 @@ set(CMAKE_AR llvm-ar)
set(CMAKE_RANLIB llvm-ranlib) set(CMAKE_RANLIB llvm-ranlib)
set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump) 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}" ${CMAKE_C_FLAGS}"
UNIQ_CMAKE_C_FLAGS) UNIQ_CMAKE_C_FLAGS)
set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}"
CACHE STRING "C Compiler Base Flags" CACHE STRING "C Compiler Base Flags"
FORCE) 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}" ${CMAKE_CXX_FLAGS}"
UNIQ_CMAKE_CXX_FLAGS) UNIQ_CMAKE_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}"
CACHE STRING "C++ Compiler Base Flags" CACHE STRING "C++ Compiler Base Flags"
FORCE) 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}" ${CMAKE_ASM_FLAGS}"
UNIQ_CMAKE_ASM_FLAGS) UNIQ_CMAKE_ASM_FLAGS)
set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}" set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}"

View File

@ -11,21 +11,21 @@ set(CMAKE_AR llvm-ar)
set(CMAKE_RANLIB llvm-ranlib) set(CMAKE_RANLIB llvm-ranlib)
set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump) 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}" ${CMAKE_C_FLAGS}"
UNIQ_CMAKE_C_FLAGS) UNIQ_CMAKE_C_FLAGS)
set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}"
CACHE STRING "C Compiler Base Flags" CACHE STRING "C Compiler Base Flags"
FORCE) 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}" ${CMAKE_CXX_FLAGS}"
UNIQ_CMAKE_CXX_FLAGS) UNIQ_CMAKE_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}"
CACHE STRING "C++ Compiler Base Flags" CACHE STRING "C++ Compiler Base Flags"
FORCE) 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}" ${CMAKE_ASM_FLAGS}"
UNIQ_CMAKE_ASM_FLAGS) UNIQ_CMAKE_ASM_FLAGS)
set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}" set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}"

View File

@ -11,21 +11,21 @@ set(CMAKE_AR llvm-ar)
set(CMAKE_RANLIB llvm-ranlib) set(CMAKE_RANLIB llvm-ranlib)
set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump) 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}" ${CMAKE_C_FLAGS}"
UNIQ_CMAKE_C_FLAGS) UNIQ_CMAKE_C_FLAGS)
set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}"
CACHE STRING "C Compiler Base Flags" CACHE STRING "C Compiler Base Flags"
FORCE) 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}" ${CMAKE_CXX_FLAGS}"
UNIQ_CMAKE_CXX_FLAGS) UNIQ_CMAKE_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}"
CACHE STRING "C++ Compiler Base Flags" CACHE STRING "C++ Compiler Base Flags"
FORCE) 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}" ${CMAKE_ASM_FLAGS}"
UNIQ_CMAKE_ASM_FLAGS) UNIQ_CMAKE_ASM_FLAGS)
set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}" set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}"

View File

@ -11,21 +11,21 @@ set(CMAKE_AR llvm-ar)
set(CMAKE_RANLIB llvm-ranlib) set(CMAKE_RANLIB llvm-ranlib)
set(CMAKE_OBJDUMP riscv32-esp-elf-clang-objdump) 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_xesppie -mabi=ilp32f \
${CMAKE_C_FLAGS}" ${CMAKE_C_FLAGS}"
UNIQ_CMAKE_C_FLAGS) UNIQ_CMAKE_C_FLAGS)
set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}" set(CMAKE_C_FLAGS "${UNIQ_CMAKE_C_FLAGS}"
CACHE STRING "C Compiler Base Flags" CACHE STRING "C Compiler Base Flags"
FORCE) 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_xesppie -mabi=ilp32f \
${CMAKE_CXX_FLAGS}" ${CMAKE_CXX_FLAGS}"
UNIQ_CMAKE_CXX_FLAGS) UNIQ_CMAKE_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}" set(CMAKE_CXX_FLAGS "${UNIQ_CMAKE_CXX_FLAGS}"
CACHE STRING "C++ Compiler Base Flags" CACHE STRING "C++ Compiler Base Flags"
FORCE) 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_xesppie -mabi=ilp32f \
${CMAKE_ASM_FLAGS}" ${CMAKE_ASM_FLAGS}"
UNIQ_CMAKE_ASM_FLAGS) UNIQ_CMAKE_ASM_FLAGS)
set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}" set(CMAKE_ASM_FLAGS "${UNIQ_CMAKE_ASM_FLAGS}"

View File

@ -2757,8 +2757,8 @@ class ChecksumFileParser():
<sha256sum-string> *<artifact-filename> <sha256sum-string> *<artifact-filename>
... (2 lines for every artifact) ... ... (2 lines for every artifact) ...
""" """
def __init__(self, tool_name: str, url: str) -> None: def __init__(self, filename_prefix: str, url: str) -> None:
self.tool_name = tool_name self.filename_prefix = filename_prefix
sha256_file_tmp = os.path.join(g.idf_tools_path, 'tools', 'add-version.sha256.tmp') sha256_file_tmp = os.path.join(g.idf_tools_path, 'tools', 'add-version.sha256.tmp')
sha256_file = os.path.abspath(url) sha256_file = os.path.abspath(url)
@ -2793,8 +2793,8 @@ class ChecksumFileParser():
raise SystemExit(1) raise SystemExit(1)
# crosstool-ng checksum file contains info about few tools # crosstool-ng checksum file contains info about few tools
# e.g.: "xtensa-esp32-elf", "xtensa-esp32s2-elf" # e.g.: "xtensa-esp32-elf", "xtensa-esp32s2-elf"
# filter records for file by tool_name to avoid mismatch # filter records for file by filename_prefix to avoid mismatch
if not hash_filename.startswith(self.tool_name): if not hash_filename.startswith(self.filename_prefix):
continue continue
size = self.parseLine(r'^# \S*: (\d*) bytes', bytes_str) size = self.parseLine(r'^# \S*: (\d*) bytes', bytes_str)
sha256 = self.parseLine(r'^(\S*) ', hash_str) sha256 = self.parseLine(r'^(\S*) ', hash_str)
@ -2828,7 +2828,8 @@ def action_add_version(args: Any) -> None:
version_obj = IDFToolVersion(version, version_status) version_obj = IDFToolVersion(version, version_status)
tool_obj.versions[version] = version_obj tool_obj.versions[version] = version_obj
url_prefix = args.url_prefix or f'https://{TODO_MESSAGE}/' url_prefix = args.url_prefix or f'https://{TODO_MESSAGE}/'
checksum_info: ChecksumFileParser = (ChecksumFileParser(tool_name, args.checksum_file) filename_prefix = args.dist_filename_prefix if len(args.dist_filename_prefix) else tool_name
checksum_info: ChecksumFileParser = (ChecksumFileParser(filename_prefix, args.checksum_file)
if args.checksum_file if args.checksum_file
else ChecksumCalculator(args.artifact_file)) # type: ignore else ChecksumCalculator(args.artifact_file)) # type: ignore
for file_size, file_sha256, file_name in checksum_info: for file_size, file_sha256, file_name in checksum_info:
@ -3160,6 +3161,9 @@ def main(argv: List[str]) -> None:
add_version.add_argument('--version', help='Version identifier', required=True) add_version.add_argument('--version', help='Version identifier', required=True)
add_version.add_argument('--url-prefix', help='String to prepend to file names to obtain download URLs') add_version.add_argument('--url-prefix', help='String to prepend to file names to obtain download URLs')
add_version.add_argument('--override', action='store_true', help='Override tool versions with new data') add_version.add_argument('--override', action='store_true', help='Override tool versions with new data')
add_version.add_argument('--dist-filename-prefix',
help='Prefix of distro archive name in checksum file. If skipped tool name is used.',
default='')
add_version_files_group = add_version.add_mutually_exclusive_group(required=True) add_version_files_group = add_version.add_mutually_exclusive_group(required=True)
add_version_files_group.add_argument('--checksum-file', help='URL or path to local file with checksum/size for artifacts') add_version_files_group.add_argument('--checksum-file', help='URL or path to local file with checksum/size for artifacts')
add_version_files_group.add_argument('--artifact-file', help='File names of the download artifacts', nargs='*') add_version_files_group.add_argument('--artifact-file', help='File names of the download artifacts', nargs='*')

View File

@ -251,6 +251,7 @@
"esp32c6", "esp32c6",
"esp32c5", "esp32c5",
"esp32h2", "esp32h2",
"esp32p4",
"esp32c61" "esp32c61"
], ],
"version_cmd": [ "version_cmd": [
@ -261,36 +262,36 @@
"versions": [ "versions": [
{ {
"linux-amd64": { "linux-amd64": {
"sha256": "c4d4bef40532b777907bdf35cf10d91432a4c6b8351ee0a21cf3332fc9aabdb1", "sha256": "aee15b8e02440f9ec6a8070f017621dc400dbd62a4701f9cf456dbe34d2a0c4d",
"size": 296940300, "size": 309829872,
"url": "https://github.com/espressif/llvm-project/releases/download/esp-17.0.1_20240419/clang-esp-17.0.1_20240419-x86_64-linux-gnu.tar.xz" "url": "https://github.com/espressif/llvm-project/releases/download/esp-18.1.2_20240912/clang-esp-18.1.2_20240912-x86_64-linux-gnu.tar.xz"
}, },
"linux-arm64": { "linux-arm64": {
"sha256": "200d12bca443f8c751dfdd8e0abdc388832820ca8ebfff86952302146b972cf9", "sha256": "14abbc368d9c153270aa4d22ce28d78633cb0f1ca83d4be70591d9e39ae9bc82",
"size": 286403588, "size": 295561044,
"url": "https://github.com/espressif/llvm-project/releases/download/esp-17.0.1_20240419/clang-esp-17.0.1_20240419-aarch64-linux-gnu.tar.xz" "url": "https://github.com/espressif/llvm-project/releases/download/esp-18.1.2_20240912/clang-esp-18.1.2_20240912-aarch64-linux-gnu.tar.xz"
}, },
"linux-armhf": { "linux-armhf": {
"sha256": "9731b04ef704748a2579ead5960a556e85ffd536d69b41022cbf2d5e59fa178c", "sha256": "4133285303aabb1831c477536a13413319a569170b0aa54b92abe69cc0e7b938",
"size": 286907980, "size": 298186872,
"url": "https://github.com/espressif/llvm-project/releases/download/esp-17.0.1_20240419/clang-esp-17.0.1_20240419-arm-linux-gnueabihf.tar.xz" "url": "https://github.com/espressif/llvm-project/releases/download/esp-18.1.2_20240912/clang-esp-18.1.2_20240912-arm-linux-gnueabihf.tar.xz"
}, },
"macos": { "macos": {
"sha256": "02ebf1c3efc8b3514b774a5c02c51a5cdd23d6d35769c1a1698006bb41e25a97", "sha256": "b4641ec4dd574b6b7d037aa1bb2e5ff5a8a4623c88e89668db656282eb1d9dc8",
"size": 272744196, "size": 282868024,
"url": "https://github.com/espressif/llvm-project/releases/download/esp-17.0.1_20240419/clang-esp-17.0.1_20240419-x86_64-apple-darwin.tar.xz" "url": "https://github.com/espressif/llvm-project/releases/download/esp-18.1.2_20240912/clang-esp-18.1.2_20240912-x86_64-apple-darwin.tar.xz"
}, },
"macos-arm64": { "macos-arm64": {
"sha256": "c422ebe6c497182020e9bb9e5896f415d3bc7635b4d996c7f16fb060124c28c2", "sha256": "5d2e187ef40ecc9996630a7c6efcc19bdfd32ec4ce8cc4dd3014cd24e7016560",
"size": 252779444, "size": 261757404,
"url": "https://github.com/espressif/llvm-project/releases/download/esp-17.0.1_20240419/clang-esp-17.0.1_20240419-aarch64-apple-darwin.tar.xz" "url": "https://github.com/espressif/llvm-project/releases/download/esp-18.1.2_20240912/clang-esp-18.1.2_20240912-aarch64-apple-darwin.tar.xz"
}, },
"name": "esp-17.0.1_20240419", "name": "esp-18.1.2_20240912",
"status": "recommended", "status": "recommended",
"win64": { "win64": {
"sha256": "341d3eed6881fbea19910fee5254a2f9c5406d2948bf0814a1c567d8c65dadcb", "sha256": "c4af15073b105dc174c0452dfd1875bab200412fa3151c0363cfc0d30abf5173",
"size": 410784492, "size": 429583224,
"url": "https://github.com/espressif/llvm-project/releases/download/esp-17.0.1_20240419/clang-esp-17.0.1_20240419-x86_64-w64-mingw32.tar.xz" "url": "https://github.com/espressif/llvm-project/releases/download/esp-18.1.2_20240912/clang-esp-18.1.2_20240912-x86_64-w64-mingw32.tar.xz"
} }
} }
] ]