Compiling with make (avr-gcc flags?)

Attempting to compile ArduCopter with make, things aren't linking correctly:

[brian@brian-arch ArduCopter]$ make
%% ArduCopter.elf
/tmp/ArduCopter.build/ArduCopter.o: In function `test_ins(unsigned char, Menu::arg const*)':
/home/brian/Documents/ardupilot/ArduCopter/test.pde:325: undefined reference to `__dso_handle'
/home/brian/Documents/ardupilot/ArduCopter/test.pde:325: undefined reference to `__dso_handle'
/home/brian/Documents/ardupilot/ArduCopter/test.pde:325: undefined reference to `__cxa_atexit'
/usr/bin/avr-ld: /tmp/ArduCopter.build/ArduCopter.elf: hidden symbol `__dso_handle' isn't defined
/usr/bin/avr-ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make: *** [/tmp/ArduCopter.build/ArduCopter.elf] Error 1

I am running Arch Linux and have installed all the dependencies via the Arch repositories, so most are probably newer versions than the Ubuntu repositories. My avr-gcc/avr-ld:

[brian@brian-arch ArduCopter]$ avr-gcc -v
Using built-in specs.
COLLECT_GCC=avr-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/avr/4.8.0/lto-wrapper
Target: avr
Configured with: /build/src/gcc-4.8.0/configure --disable-cloog-version-check --disable-install-libiberty --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-linker-build-id --disable-nls --disable-werror --enable-__cxa_atexit --enable-checking=release --enable-clocale=gnu --enable-cloog-backend=isl --enable-gnu-unique-object --enable-gold --enable-languages=c,c++ --enable-ld=default --enable-lto --enable-plugin --enable-shared --infodir=/usr/share/info --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --prefix=/usr --target=avr --with-as=/usr/bin/avr-as --with-gnu-as --with-gnu-ld --with-ld=/usr/bin/avr-ld --with-plugin-ld=ld.gold --with-system-zlib
Thread model: single
gcc version 4.8.0 (GCC)
[brian@brian-arch ArduCopter]$ avr-ld -v
GNU ld (GNU Binutils) 2.23.2

Any suggestions would be much appreciated. Might I have to build avr-gcc with different options, or is there something in board_avr.mk (I'm building for APM 2.6) that I could change?

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Did you solve this? I'm in same boat.

This reply was deleted.

Activity