LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (http://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   Final Phase GCC build fails for ARM cross compiler toolchain (http://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/final-phase-gcc-build-fails-for-arm-cross-compiler-toolchain-913032/)

bencpeters 11-11-2011 10:57 AM

Final Phase GCC build fails for ARM cross compiler toolchain
 
Hi all, I'm working on building a cross compiler tool chain to allow me to compile for an embedded Debian on an ARM9 system (a Technologic TS7550). I develop on a Macbook Pro, and I've gotten a tool chain working in an Ubuntu VM using binaries provided by Technologic; however, I would like to have OS X native binaries.

I've found some directions online, and have been able to build binutils, bootstrap GCC, and newlib. Unfortunately, the final (full) GCC build fails on libgomp. This is the configure command I'm using:

Code:

../configure --prefix=/Users/benpeters/NFS/arm-linux-osx/ --target=arm-unknown-linux-gnu --enable-interwork --enable-languages="c,c++" --enable-multilib --with-newlib --disable-nls --disable-shared --disable-threads --with-gnu-as --with-gnu-ld --with-gmp=/Users/benpeters/Downloads/armtoolchain/gmp --with-mpfr=/Users/benpeters/Downloads/armtoolchain/mpfr --with-mpc=/Users/benpeters/Downloads/armtoolchain/mpc
and the error:

Code:

checking for arm-unknown-linux-gnu-gcc... /Users/benpeters/Downloads/armtoolchain/gcc-4.6.2/build/./gcc/xgcc -B/Users/benpeters/Downloads/armtoolchain/gcc-4.6.2/build/./gcc/ -B/Users/benpeters/NFS/arm-linux-osx/arm-unknown-linux-gnu/bin/ -B/Users/benpeters/NFS/arm-linux-osx/arm-unknown-linux-gnu/lib/ -isystem /Users/benpeters/NFS/arm-linux-osx/arm-unknown-linux-gnu/include -isystem /Users/benpeters/NFS/arm-linux-osx/arm-unknown-linux-gnu/sys-include 
checking for C compiler default output file name...
configure: error: in `/Users/benpeters/Downloads/armtoolchain/gcc-4.6.2/build/arm-unknown-linux-gnu/libgomp':
configure: error: C compiler cannot create executables
See `config.log' for more details.
make[1]: *** [configure-target-libgomp] Error 1
make: *** [all] Error 2

I looked in the config.log file for libgomp, and here is the relevant portion:

Code:

configure:3635: /Users/benpeters/Downloads/armtoolchain/gcc-4.6.2/build/./gcc/xgcc -B/Users/benpeters/Downloads
/armtoolchain/gcc-4.6.2/build/./gcc/ -B/Users/benpeters/NFS/arm-linux-osx/arm-unknown-linux-gnu/bin/ -B/Users/b
enpeters/NFS/arm-linux-osx/arm-unknown-linux-gnu/lib/ -isystem /Users/benpeters/NFS/arm-linux-osx/arm-unknown-l
inux-gnu/include -isystem /Users/benpeters/NFS/arm-linux-osx/arm-unknown-linux-gnu/sys-include    -V >&5
xgcc: error: unrecognized option '-V'
xgcc: fatal error: no input files
compilation terminated.
configure:3646: $? = 1
configure:3635: /Users/benpeters/Downloads/armtoolchain/gcc-4.6.2/build/./gcc/xgcc -B/Users/benpeters/Downloads
/armtoolchain/gcc-4.6.2/build/./gcc/ -B/Users/benpeters/NFS/arm-linux-osx/arm-unknown-linux-gnu/bin/ -B/Users/b
enpeters/NFS/arm-linux-osx/arm-unknown-linux-gnu/lib/ -isystem /Users/benpeters/NFS/arm-linux-osx/arm-unknown-l
inux-gnu/include -isystem /Users/benpeters/NFS/arm-linux-osx/arm-unknown-linux-gnu/sys-include    -qversion >&5
xgcc: error: unrecognized option '-qversion'
xgcc: fatal error: no input files
compilation terminated.
configure:3646: $? = 1
configure:3666: checking for C compiler default output file name
configure:3688: /Users/benpeters/Downloads/armtoolchain/gcc-4.6.2/build/./gcc/xgcc -B/Users/benpeters/Downloads
/armtoolchain/gcc-4.6.2/build/./gcc/ -B/Users/benpeters/NFS/arm-linux-osx/arm-unknown-linux-gnu/bin/ -B/Users/b
enpeters/NFS/arm-linux-osx/arm-unknown-linux-gnu/lib/ -isystem /Users/benpeters/NFS/arm-linux-osx/arm-unknown-l
inux-gnu/include -isystem /Users/benpeters/NFS/arm-linux-osx/arm-unknown-linux-gnu/sys-include    -g -O2  conf
test.c  >&5
/Users/benpeters/NFS/arm-linux-osx/arm-unknown-linux-gnu/bin/ld: cannot find crt1.o: No such file or directory
/Users/benpeters/NFS/arm-linux-osx/arm-unknown-linux-gnu/bin/ld: cannot find crti.o: No such file or directory
/Users/benpeters/NFS/arm-linux-osx/arm-unknown-linux-gnu/bin/ld: cannot find -lc
/Users/benpeters/NFS/arm-linux-osx/arm-unknown-linux-gnu/bin/ld: cannot find crtn.o: No such file or directory
collect2: ld returned 1 exit status
configure:3692: $? = 1
configure:3729: result:
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU OpenMP Runtime Library"
| #define PACKAGE_TARNAME "libgomp"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU OpenMP Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgomp/"
| #define PACKAGE "libgomp"
| #define VERSION "1.0"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|  ;
|  return 0;
| }
configure:3735: error: in `/Users/benpeters/Downloads/armtoolchain/gcc-4.6.2/build/arm-unknown-linux-gnu/libgomp':
configure:3739: error: C compiler cannot create executables

As far as I can figure out, it's trying to use this "xgcc" which is a bootstrapped cross compiler from stage 1 of the build to build something in the libgomp config, but it's missing some library files? (the crt1.o, crti.o, etc.) Can anyone shed some more light on this?

thanks!!!

theNbomr 11-13-2011 05:23 PM

Do yourself a favor, and leverage the experience and testing by a cast of thousands. Use Crosstool-NG to build your toolchain. Building a cross toolchain is non-trivial, and what you end up with will fail in mysterious ways if you haven't done everything just right. The developers and users of Crosstool-NG have been through all of the things you're trying, solved all of the problems, as well as a bunch you haven't thought of yet, and created a nice tool to help you build your toolchain. There is an active mailing list with ample friendly and timely help.
--- rod.


All times are GMT -5. The time now is 02:53 AM.