platformio / platform-renesas-ra

Renesas RA: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/renesas-ra
Apache License 2.0
10 stars 4 forks source link

cannot compile with -flto flag #21

Closed cyberic99 closed 7 months ago

cyberic99 commented 7 months ago

I get build errors as soon as I add -flto to the build flags.

I was also able to reproduce the issue on the arduino-blink example

Just adding

build_flags = -flto

makes the build fail with:

arm-none-eabi-ar: .pio/build/uno_r4_wifi/FrameworkArduino/tinyusb/class/msc/msc_host.c.o: plugin needed to handle lto object
arm-none-eabi-ar: .pio/build/uno_r4_wifi/FrameworkArduino/tinyusb/class/net/ecm_rndis_device.c.o: plugin needed to handle lto object
arm-none-eabi-ar: .pio/build/uno_r4_wifi/FrameworkArduino/tinyusb/class/net/ncm_device.c.o: plugin needed to handle lto object
arm-none-eabi-ar: .pio/build/uno_r4_wifi/FrameworkArduino/tinyusb/class/usbtmc/usbtmc_device.c.o: plugin needed to handle lto object
arm-none-eabi-ar: .pio/build/uno_r4_wifi/FrameworkArduino/tinyusb/class/vendor/vendor_device.c.o: plugin needed to handle lto object
arm-none-eabi-ar: .pio/build/uno_r4_wifi/FrameworkArduino/tinyusb/class/vendor/vendor_host.c.o: plugin needed to handle lto object
.platformio/packages/framework-arduinorenesas-uno/variants/UNOWIFIR4/libs/libfsp.a(startup.o): In function `Reset_Handler':
/ssd/products-Eslov/FW/MainPrograms/hardware/arduino-git/renesas/extras/e2studioProjects/Santiago/Debug/../ra/fsp/src/bsp/cmsis/Device/RENESAS/Source/startup.c:67: undefined reference to `main'

I was able to use the flag when going back to v1.2.0 like this:

platform = renesas-ra@1.2.0

Thank you

valeros commented 7 months ago

Hi @cyberic99, this behavior is probably caused by the downgrade of the toolchain version needed by https://github.com/platformio/platform-renesas-ra/issues/18. Unfortunately, newer toolchains cannot be used at the moment.