GCC 8-2018-q4
Windows 10 64-bit
Errors:
ELF section name out of range
ld: lto-wrapper failed
The project(s) are generated with the GNU MCU Eclipse STM32F4 template.
I tried both C and C++ projects, both fail if I enable LTO, and build properly if I disable LTO.
The console reads:
c:/users/ilg/appdata/roaming/gnu tools arm embedded/8-2018-q4/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: error: C:\Users\ilg\AppData\Local\Temp\cc08jQRZdebugobjtem: ELF section name out of range
collect2.exe: error: ld returned 1 exit status
lto-wrapper.exe: fatal error: arm-none-eabi-g++ returned 1 exit status
compilation terminated.
c:/users/ilg/appdata/roaming/gnu tools arm embedded/8-2018-q4/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: error: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:64: f4b-lto.elf] Error 1
"make all" terminated with exit code 2. Build might be incomplete.
Both the original Arm binary and the similar GNU MCU Eclipse ARM Embedded GCC binary behave the same.
The problem seems to affect only the Windows binary; on Linux and macOS, projects created with exactly the same procedure, pass the build as expected.
GCC 8-2018-q4
Windows 10 64-bit
Errors:
ELF section name out of range
ld: lto-wrapper failed
The project(s) are generated with the GNU MCU Eclipse STM32F4 template.
I tried both C and C++ projects, both fail if I enable LTO, and build properly if I disable LTO.
The console reads:
c:/users/ ilg/appdata/ roaming/ gnu tools arm embedded/ 8-2018- q4/bin/ ../lib/ gcc/arm- none-eabi/ 8.2.1/. ./../.. /../arm- none-eabi/ bin/ld. exe: error: C:\Users\ ilg\AppData\ Local\Temp\ cc08jQRZdebugob jtem: ELF section name out of range ilg/appdata/ roaming/ gnu tools arm embedded/ 8-2018- q4/bin/ ../lib/ gcc/arm- none-eabi/ 8.2.1/. ./../.. /../arm- none-eabi/ bin/ld. exe: error: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status
lto-wrapper.exe: fatal error: arm-none-eabi-g++ returned 1 exit status
compilation terminated.
c:/users/
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:64: f4b-lto.elf] Error 1
"make all" terminated with exit code 2. Build might be incomplete.
Both the original Arm binary and the similar GNU MCU Eclipse ARM Embedded GCC binary behave the same.
The problem seems to affect only the Windows binary; on Linux and macOS, projects created with exactly the same procedure, pass the build as expected.
Building target: f4b-lto.elf "f4b-lto. map" --specs=nano.specs -o "f4b-lto.elf" ./system/ src/stm32f4- hal/stm32f4xx_ hal.o ./system/ src/stm32f4- hal/stm32f4xx_ hal_cortex. o ./system/ src/stm32f4- hal/stm32f4xx_ hal_dfsdm. o ./system/ src/stm32f4- hal/stm32f4xx_ hal_flash. o ./system/ src/stm32f4- hal/stm32f4xx_ hal_gpio. o ./system/ src/stm32f4- hal/stm32f4xx_ hal_iwdg. o ./system/ src/stm32f4- hal/stm32f4xx_ hal_pwr. o ./system/ src/stm32f4- hal/stm32f4xx_ hal_rcc. o ./system/ src/newlib/ _cxx.o ./system/ src/newlib/ _exit.o ./system/ src/newlib/ _sbrk.o ./system/ src/newlib/ _startup. o ./system/ src/newlib/ _syscalls. o ./system/ src/newlib/ assert. o ./system/ src/diag/ Trace.o ./system/ src/diag/ trace_impl. o ./system/ src/cortexm/ _initialize_ hardware. o ./system/ src/cortexm/ _reset_ hardware. o ./system/ src/cortexm/ exception_ handlers. o ./system/ src/cmsis/ system_ stm32f4xx. o ./system/ src/cmsis/ vectors_ stm32f407xx. o ./src/BlinkLed.o ./src/Timer.o ./src/_ initialize_ hardware. o ./src/_write.o ./src/main.o ./src/stm32f4xx _hal_msp. o
Invoking: GNU ARM Cross C++ Linker
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=soft -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -flto -Wall -Wextra -g -T mem.ld -T libs.ld -T sections.ld -nostartfiles -Xlinker --gc-sections -L"../ldscripts" -Wl,-Map,
Finished building target: f4b-lto.elf