.build/uno/src/sketch.o: In function `_GLOBAL__sub_I_mySerial':
/fail/src/sketch.ino:3: undefined reference to `__dso_handle'
/fail/src/sketch.ino:3: undefined reference to `__dso_handle'
/fail/src/sketch.ino:3: undefined reference to `__cxa_atexit'
/usr/bin/avr-ld: .build/uno/firmware.elf: hidden symbol `__dso_handle' isn't defined
/usr/bin/avr-ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
.build/uno/Makefile:201: recipe for target '.build/uno/firmware.elf' failed
make: *** [.build/uno/firmware.elf] Error 1
Make failed with code 2
From what I understand, this comes from gcc > 4.8 including -fuse-cxa-atexit by default. So, compiling with: ino build --cppflags="-fno-use-cxa-atexit -ffunction-sections -fdata-sections -g -Os -w" works fine.
Hi, I installed ino on Arch Linux, with avr-gcc 4.9.0
I'm trying to compile a simple sketch:
But the compilation fails with:
From what I understand, this comes from gcc > 4.8 including -fuse-cxa-atexit by default. So, compiling with:
ino build --cppflags="-fno-use-cxa-atexit -ffunction-sections -fdata-sections -g -Os -w"
works fine.I see the change in README, in v0.3.4 that perhaps was to prevent these kind of things, however, the AUR arduino package does not ship with avr gcc. Instead, the maintainer patched the boards.txt file to include a new option (https://github.com/WarheadsSE/PKGs/blob/master/arduino/arduino-gcc-4.8-no-use-cxa-atexit.patch).
I think the better option with ino would be to detect the avr-gcc version and add the -fno-use-cxa-atexit flag.
Would this be feasible?