From 3577e7a6ed0f183534e207179de5251e155fd49e Mon Sep 17 00:00:00 2001 From: seteiro Date: Sat, 10 Oct 2026 20:34:34 +0800 Subject: [components][libc] run .init_array constructors in cplusplus_system_init Newer GCC emits C++ global constructors into .init_array, which many linker scripts keep outside [__ctors_start__, __ctors_end__), so they never ran. Walk __init_array_start/__init_array_end (weak) as well, skipping entries already covered by the ctors range. Add RT_USING_CPP_CRT_INIT for ports whose startup runtime already runs .init_array, default on for the simulator. With it set, only the .init_array walk is skipped; the ctors range is still walked. Renesas RA/RA_WIRELESS/RZ families select it when C++ is enabled: FSP SystemInit() already walks .init_array, so boards whose linker script only provides __init_array_* would run constructors twice. Boards that fold .init_array into the ctors range (ra6m3-hmi-board, ra8d1, rz) still run them once via RT-Thread. Also source env.sh and restore RTT_EXEC_PATH in ToolsCI project generate and dist steps so scons is on PATH (exit 127) and the ARM toolchain path is not overwritten by env.sh. Fixes #11778 --- .github/workflows/action_tools.yml | 5 +++++ 1 file changed, 5 insertions(+) (limited to '.github/workflows') diff --git a/.github/workflows/action_tools.yml b/.github/workflows/action_tools.yml index b3e1b954d4..c9111de9d0 100644 --- a/.github/workflows/action_tools.yml +++ b/.github/workflows/action_tools.yml @@ -67,6 +67,7 @@ jobs: - name: Build Tools run: | source ~/.env/env.sh + export RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin scons --pyconfig-silent -C $TEST_BSP_ROOT 2>menuconfig.log cat menuconfig.log if grep -q "warning:" menuconfig.log; then @@ -79,6 +80,8 @@ jobs: - name: Project generate Tools if: ${{ success() }} run: | + source ~/.env/env.sh + export RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin echo "Test to generate eclipse project" scons --target=eclipse -s -C $TEST_BSP_ROOT echo "Test to generate cmake project" @@ -89,6 +92,8 @@ jobs: - name: Project dist Tools if: ${{ success() }} run: | + source ~/.env/env.sh + export RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin echo "Test to dist project" scons --dist -C $TEST_BSP_ROOT scons --dist-ide -C $TEST_BSP_ROOT -- cgit v1.3.1