Cross Compiling libsndfile for Teensy3.0

Status
Not open for further replies.

kellydunn

Member
I would like to introduce logic in my teensy firmware such that I can read and write audio data to an SD card. I'm currently evaluating libsndfile, but I'm running into problems with cross compiling the library. When configuring libsndfile for cross compilation, it errors out while compiling a test program with the following error:

Code:
arm-none-eabi-gcc: fatal error: selected multilib '.' not recognized

You can read a more verbose output here, in this gist.

Interestingly enough, it seems as though that my current toolchain only knows about the following multilibs:

Code:
$ arm-none-eabi-gcc -print-multi-lib
.;
thumb2;@mthumb@march=armv7

Is there something I'm missing? Is there a preferred cross-compile toolchain for the Teensy3?

Thanks in advance!
 
Yes. Use the toolchain the Teensyduino installer places in hardware/tools/arm-none-eabi

See the example makefile in hardware/teensy/cores/teensy3 for more info.

To my knowledge, I am currently using the toolchain that is provided by the Teensduino installer:

Code:
kelly in ~/Downloads/libsndfile-1.0.25
$ which arm-none-eabi-gcc
/home/kelly/work/arduino-1.0.5/hardware/tools/arm-none-eabi/bin/arm-none-eabi-gcc

kelly in ~/Downloads/libsndfile-1.0.25
$ arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/home/kelly/work/arduino-1.0.5/hardware/tools/arm-none-eabi/bin/../libexec/gcc/arm-none-eabi/4.7.2/lto-wrapper
Target: arm-none-eabi
Configured with: /home/paul/teensy/arm64/workdir/gcc-4.7-2012.09/configure --prefix=/usr/local --target=arm-none-eabi --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --enable-extra-sgxxlite-multilibs --with-gnu-as --with-gnu-ld --with-specs='%{save-temps: -fverbose-asm} %{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}' --enable-languages=c,c++ --disable-shared --enable-lto --with-newlib --with-pkgversion='PJRC Build of GNU Toolchain from CodeSourcery' --with-bugurl=http://forum.pjrc.com/ --disable-nls --with-headers=yes --with-sysroot=/usr/local/arm-none-eabi --with-build-sysroot=/home/paul/teensy/arm64/arm-none-eabi/arm-none-eabi --with-gmp=/home/paul/teensy/arm64/staticlib --with-mpfr=/home/paul/teensy/arm64/staticlib --with-mpc=/home/paul/teensy/arm64/staticlib --with-ppl=/home/paul/teensy/arm64/staticlib --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-cloog=/home/paul/teensy/arm64/staticlib --with-libelf=/home/paul/teensy/arm64/staticlib --disable-libgomp --disable-libitm --enable-poison-system-directories --with-build-time-tools=/home/paul/teensy/arm64/arm-none-eabi/arm-none-eabi/bin
Thread model: single
gcc version 4.7.2 (PJRC Build of GNU Toolchain from CodeSourcery)

So it seems as though I'd be using the PJRC arm-none-eabi toolchain when I attempt to configure libsndfile with the following command:

Code:
CC=arm-none-eabi-gcc ./configure --host=arm-none-eabi

But it continues to error out with the message listed above :(. Am I missing something?
 
Ah, I think I learned why it wasn't working. I believe it had something to do with the LDFLAGS that get set in the Makefile you mentioned. I appended the LDFLAGS listed in the Makefile to my configure command, and things seem to build building now:

Code:
CC="arm-none-eabi-gcc -Os -Wl,--gc-sections -mcpu=cortex-m4 -mthumb -T/home/kelly/work/arduino-1.0.5/hardware/teensy/cores/teensy3/mk20dx128.ld" ./configure --host=arm-none-eabi
 
Status
Not open for further replies.
Back
Top