2026-03-16
2:11 AM
- last edited on
2026-04-24
1:15 AM
by
Maxime_MARCHETT
Hi,
I'm working on an stm32U0 with Makefile generated by CubeMX v6.17.0. The code has been built with:
arm-none-eabi-gcc (Arm GNU Toolchain 14.3.Rel1 (Build arm-14.174)) 14.3.1 20250623
on a GNU/Linux machine.
When I appended the -flto switch to the ASFLAGS, CFLAGS and LDFLAGS variables in the Makefile, this triggered a warning:
lto-wrapper: warning: Options to '-Xassembler' do not match: -alms=/tmp/app/release/main.lst, -alms=/tmp/app/release/gpio.lst, dropping all '-Xassembler' and '-Wa' options.
The .elf file was generating and it seems to be working. The code built with flag -O2.
I wouldn't want this warning to lead to unexpected errors. Does anyone have experience with LTO and can tell me if it's a good idea to use it? I can't figure out if GCC bug.
Many thanks.