When I compile a demo in the trunk branch, my compiler (well, linker) reliably crashes:
assurancetourix:~/stm32/ChibiOS-RT/demos/STM32/RT-STM32F407-DISCOVERY-MEMS> make USE_VERBOSE_COMPILE=yes
arm-none-eabi-gcc build/obj/chcoreasm_v7m.o build/obj/crt0.o build/obj/vectors.o build/obj/chcore.o build/obj/chcore_v7m.o build/obj/chsys.o build/obj/chdebug.o build/obj/chtm.o build/obj/chstats.o build/obj/chschd.o build/obj/chvt.o build/obj/chthreads.o build/obj/chdynamic.o build/obj/chregistry.o build/obj/chsem.o build/obj/chmtx.o build/obj/chcond.o build/obj/chevents.o build/obj/chmsg.o build/obj/chmboxes.o build/obj/chqueues.o build/obj/chmemcore.o build/obj/chheap.o build/obj/chmempools.o build/obj/test.o build/obj/testthd.o build/obj/testsem.o build/obj/testmtx.o build/obj/testmsg.o build/obj/testmbox.o build/obj/testevt.o build/obj/testheap.o build/obj/testpools.o build/obj/testdyn.o build/obj/testqueues.o build/obj/testbmk.o build/obj/hal.o build/obj/hal_queues.o build/obj/hal_mmcsd.o build/obj/adc.o build/obj/can.o build/obj/dac.o build/obj/ext.o build/obj/gpt.o build/obj/i2c.o build/obj/i2s.o build/obj/icu.o build/obj/mac.o build/obj/mmc_spi.o build/obj/pal.o build/obj/pwm.o build/obj/rtc.o build/obj/sdc.o build/obj/serial.o build/obj/serial_usb.o build/obj/spi.o build/obj/st.o build/obj/uart.o build/obj/usb.o build/obj/osal.o build/obj/nvic.o build/obj/stm32_dma.o build/obj/hal_lld.o build/obj/adc_lld.o build/obj/ext_lld_isr.o build/obj/can_lld.o build/obj/ext_lld.o build/obj/mac_lld.o build/obj/sdc_lld.o build/obj/dac_lld.o build/obj/pal_lld.o build/obj/i2c_lld.o build/obj/usb_lld.o build/obj/rtc_lld.o build/obj/i2s_lld.o build/obj/spi_lld.o build/obj/gpt_lld.o build/obj/icu_lld.o build/obj/pwm_lld.o build/obj/st_lld.o build/obj/serial_lld.o build/obj/uart_lld.o build/obj/board.o build/obj/lis302dl.o build/obj/shell.o build/obj/chprintf.o build/obj/usbcfg.o build/obj/main.o -mcpu=cortex-m4 -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -ffunction-sections -fdata-sections -fno-common -flto -nostartfiles -Wl,-Map=build/ch.map,--cref,--no-warn-mismatch,--library-path=../../../os/common/ports/ARMCMx/compilers/GCC,--script=../../../os/common/ports/ARMCMx/compilers/GCC/ld/STM32F407xG.ld,--gc-sections,--defsym=process_stack_size=0x400,--defsym=main_stack_size=0x400 -mno-thumb-interwork -mthumb -o build/ch.elf
../../../test/rt/test.c: In function 'TestThread':
../../../test/rt/test.c:314:7: internal compiler error: Segmentation fault
msg_t TestThread(void *p) {
On the one hand, the compiler shouldn't crash, on the other hand, Just the recent chibios sources cause this, I can compile other projects and the version in 2.6.5 just fine.
In the other F407-discovery demo, the linker points at "main.c" as to where it got before it crashed.
The compiler package was installed from the Ubuntu repository:
4.8.2-14ubuntu1+6 (/var/lib/apt/lists/nl.archive.ubuntu.com_ubuntu_dists_trusty_universe_binary-amd64_Packages) (/var/lib/dpkg/status)
Oh!!!! now I remember: On my other "arm-development-capable" system I get:
Linking build/ch.elf
/tmp/cc5oVs5n.ltrans7.ltrans.o: In function _unhandled_exception':
/home/wolff/stm32/ChibiOS-RT/demos/STM32/RT-STM32F407-DISCOVERY/../../../os/common/ports/ARMCMx/compilers/GCC/vectors.c:77: multiple definition of
Reset_Handler'
/tmp/cc5oVs5n.ltrans5.ltrans.o:/home/wolff/stm32/ChibiOS-RT/demos/STM32/RT-STM32F407-DISCOVERY/../../../os/common/ports/ARMCMx/compilers/GCC/crt0.c:267: first defined here
and a similar message about: SVC_Handler and VectorB0 .
I'm guessing that this might be the root cause.
Hi,
This is probably a problem with GCC 4.8.x and LTO, it has been discussed for a while in the forum. The fix is apparently scheduled for GCC 4.9.x.
You could disable LTO in the makefile or downgrade to GCC 4.7.x, both should fix the issue.
Giovanni
Diff:
Setting LTO to "no" fixes this. Thanks for pointing me in the right direction!
[edit] As the "owner" can't I close this? It's still tagged as "open". I've played "bugmanager" for an open source project, so I'm a bit like: close ASAP what can/should be closed.
Last edit: Roger Wolff 2014-07-08
closed