3

I'm trying to get a working cross-compiler running under Linux (Debian squeeze amd64) but I can't seem to link my files with the installed libsndfile, I'm assuming I need to cross-compile the source to target the Raspberry-Pi and link to that version. But I can't seem to find straightforward instructions on doing the ./configure and make stage to compile to the target.

Note: I followed these steps: How do I build a GCC 4.7 toolchain for cross-compiling? to get the cross compiler built and using Eclipse.

Community
  • 1
  • 1
Dog Ears
  • 9,637
  • 5
  • 37
  • 54
  • What is the name of the cross-compiler? It should be -gcc. – Erik de Castro Lopo Jul 23 '12 at 09:08
  • @ErikdeCastroLopo - Cheers for taking the time to answer, I'll warn you I'm a complete noob to this linux/cross-compilation stuff. The compiler is: arm-unknown-linux-gnueabi-gcc built using the crosstools-ng tool. – Dog Ears Jul 23 '12 at 12:48
  • Beware, I am seeing some issues with its configure script determining largefile support, and getting it wrong when building on a 64-bit host machine. Rename `AC_SYS_EXTRA_LARGEFILE` to `AC_SYS_LARGEFILE` in `configure.ac`, and then it seems to build properly on 64-bit hosts. – Craig McQueen Dec 24 '13 at 02:51

1 Answers1

5

Ok, what you want to do is something which you probably cannot do within Eclipse.

Instead you need a terminal (eg xterm or gnome-terminal). The you need to run the configure script with something along the lines of:

./configure --prefix=$HOME/Arm --build=i386-linux --host=arm-unknown-linux-gnueabi

Watch the configure output to make sure that the configure script picks up the correct compiler and then do:

make && make install

When you then want to build something else that links against the Arm binaries, make sure they get the headers from $HOME/Arm/include and link against the library in $HOME/Arm/lib.

You should be able to find lots of documentation about cross compiling stuff that uses autoconf generated configure scripts on the net.