andysworkshop / stm32plus

The C++ library for the STM32 F0, F100, F103, F107 and F4 microcontrollers
http://www.andybrown.me.uk
Other
745 stars 224 forks source link

Linker error with GCC 6.3.1 #214

Open mechatrocity opened 6 years ago

mechatrocity commented 6 years ago

When I try to build with GCC 6.3.1 I'm getting the following error;

arm-none-eabi-g++ -o examples/adc_analog_watchdog/build/small-f4-25000000e/adc_analog_watchdog.elf -Xlinker --gc-sections -mthumb -g3 -gdwarf-2 -mcpu=cortex-m4 -Texamples/adc_analog_watchdog/system/f407_168_8/Linker.ld -Wl,-wrap,aeabi_unwind_cpp_pr0 -Wl,-wrap,__aeabi_unwind_cpp_pr1 -Wl,-wrap,aeabi_unwind_cpp_pr2 -Wl,-wrap,atexit examples/adc_analog_watchdog/build/small-f4-25000000e/adc_analog_watchdog.o examples/adc_analog_watchdog/build/small-f4-25000000e/system/LibraryHacks.o examples/adc_analog_watchdog/build/small-f4-25000000e/system/f407_168_8/Startup.o examples/adc_analog_watchdog/build/small-f4-25000000e/system/f407_168_8/System.o lib/build/small-f4-25000000e/libstm32plus-small-f4-25000000e.a /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: error: /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/crt0.o: Conflicting CPU architectures 13/1 /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: failed to merge target specific data of file /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/crt0.o collect2: error: ld returned 1 exit status scons: *** [examples/adc_analog_watchdog/build/small-f4-25000000e/adc_analog_watchdog.elf] Error 1

Resulted from scons mode=small mcu=f4 hse=25000000.

Any known issues with this and the latest GCC?

mikepurvis commented 6 years ago

FWIW, I was able to compile stm32plus with the GCC 7 toolchain from gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2 direct from ARM.

However, if you're using the compiler that's part of the future Ubuntu Bionic and the stm32plus build is breaking somehow, we should definitely figure out why and fix it up.