Files
rt-thread/.github/workflows/action_tools.yml
T
seteiro 3577e7a6ed [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
2026-10-11 16:11:07 +08:00

105 lines
3.2 KiB
YAML

name: ToolsCI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
# Runs at 16:00 UTC (BeiJing 00:00) on the 1st of every month
schedule:
- cron: '0 16 1 * *'
push:
branches:
- master
paths-ignore:
- documentation/**
- '**/README.md'
- '**/README_zh.md'
- '**/*.c'
- '**/*.h'
- '**/*.cpp'
pull_request:
branches:
- master
paths-ignore:
- documentation/**
- '**/README.md'
- '**/README_zh.md'
- '**/*.c'
- '**/*.h'
- '**/*.cpp'
workflow_dispatch:
repository_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
test:
runs-on: ubuntu-22.04
name: Tools
if: github.repository_owner == 'RT-Thread'
strategy:
fail-fast: false
env:
TEST_BSP_ROOT: bsp/stm32/stm32f407-atk-explorer
steps:
- uses: actions/checkout@main
- name: Install Tools
shell: bash
run: |
wget https://raw.githubusercontent.com/RT-Thread/env/master/install_ubuntu.sh
chmod 777 install_ubuntu.sh
./install_ubuntu.sh
- name: Install Arm ToolChains
if: ${{ success() }}
shell: bash
run: |
wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.3/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
sudo tar xjf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 -C /opt
/opt/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gcc --version
echo "RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin" >> $GITHUB_ENV
- 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
echo "Errors found in menuconfig, failing the build."
exit 1
fi
pushd $TEST_BSP_ROOT && pkgs --update && popd
scons -j$(nproc) -C $TEST_BSP_ROOT
- 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"
scons --target=cmake -s -C $TEST_BSP_ROOT
echo "Test to generate makefile project"
scons --target=makefile -s -C $TEST_BSP_ROOT
- 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
ls $TEST_BSP_ROOT
ls $TEST_BSP_ROOT/dist
scons --pyconfig-silent -C $TEST_BSP_ROOT/dist/project
scons --pyconfig-silent -C $TEST_BSP_ROOT/rt-studio-project
scons -C $TEST_BSP_ROOT/dist/project
scons -C $TEST_BSP_ROOT/rt-studio-project