mirror of
https://github.com/apache/nuttx.git
synced 2026-08-05 22:29:02 +00:00
For boards b-g431b-esc1/nsh, nucleo-g431kb/nsh and nucleo-g431rb/nsh,
the `.data` section of nuttx.elf overflows the 128 KB flash region by a
few hundred bytes on default GNU EABI builds:
arm-none-eabi-ld: nuttx section `.data' will not fit in region `flash'
arm-none-eabi-ld: region `flash' overflowed by 296 bytes
Enabling CONFIG_LTO_FULL=y in the corresponding defconfigs brings flash
usage back below the 128 KB limit (~93%).
Additionally, fix arch/arm/src/cmake/gcc.cmake so that when LTO is
enabled it always uses the gcc-ar / gcc-nm / gcc-ranlib wrappers, not
just when CONFIG_ARM_TOOLCHAIN_GNU_EABI is also set. CI tooling (via
tools/testbuild.sh) configures cmake first, then flips the toolchain
choice in .config with kconfig-tweak before running `cmake --build`.
With the previous "ARM_TOOLCHAIN_GNU_EABI && !LTO_NONE" guard the
regen step would switch to plain `ar` for the .a files, even though the
linker driver picked at configure time is still arm-none-eabi-g++ and
the object files contain GCC LTO IR. The result was a flood of
"undefined reference to `printf' / `free' / `puts' ..." link errors
when running tools/testbuild.sh -A -N -R on the *_CLANG variants.
Now that we are inside gcc.cmake the toolchain is unambiguously GCC,
so dropping the redundant CONFIG_ARM_TOOLCHAIN_GNU_EABI conjunct keeps
the LTO-aware ar wrappers in place across kconfig-tweak toolchain
switches.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
|
||
|---|---|---|
| .. | ||
| arm-01.dat | ||
| arm-02.dat | ||
| arm-03.dat | ||
| arm-04.dat | ||
| arm-05.dat | ||
| arm-06.dat | ||
| arm-07.dat | ||
| arm-08.dat | ||
| arm-09.dat | ||
| arm-10.dat | ||
| arm-11.dat | ||
| arm-12.dat | ||
| arm-13.dat | ||
| arm-14.dat | ||
| arm64-01.dat | ||
| codechecker.dat | ||
| macos.dat | ||
| msys2.dat | ||
| other.dat | ||
| risc-v-01.dat | ||
| risc-v-02.dat | ||
| risc-v-03.dat | ||
| risc-v-04.dat | ||
| risc-v-05.dat | ||
| risc-v-06.dat | ||
| risc-v-07.dat | ||
| sim-01.dat | ||
| sim-02.dat | ||
| sim-03.dat | ||
| windows.dat | ||
| x86_64-01.dat | ||
| xtensa-00.dat | ||
| xtensa-01.dat | ||
| xtensa-02.dat | ||
| xtensa-03.dat | ||