1
votes

I was following http://www.openrisc.net/toolchain-build.html to learn how to setup cross compiler toolchain. and have gone down to rebuilding uClibc and found the library files are not installed in ${SYSROOT}/usr/lib correctly. (only 5 out of 8 files are copied anyhow) So I tried to do it over from scratch and now I'm stuck in compiling gcc for the first pass..

I previously installed gmp, mpfr and mpc. they were installed under /usr/local. (the headers are in /usr/local/include and the libraries are in /usr/local/lib) So for the gcc compile, I ran (at gcc-build directory)

../gcc-svn/configure --target=or32-linux --prefix=$PREFIX --disable-libssp --srcdir=../gcc-svn --enable-languages=c -- without-headers --enable-threads=single --disable-libgomp --disable-libmudflap --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local

and ran

make

and it gives me this error message (showing the error part) checking for suffix of object files... configure: error: in /home/ckim/openrisc/toolchain/gcc-build/or32-linux/libgcc': configure: error: cannot compute suffix of object files: cannot compile Seeconfig.log' for more details. make[1]: * [configure-target-libgcc] Error 1 make[1]: Leaving directory `/home/ckim/openrisc/toolchain/gcc-build' make: * [all] Error 2

so I looked into /home/ckim/openrisc/toolchain/or32-linux/libgcc/config.log file. The errored part shows this. (full log file is at http://pastebin.com/6HdfrqBy)

....

configure:3020: /home/ckim/openrisc/toolchain/gcc-build/./gcc/xgcc -B/home/ckim/openrisc/toolchain/gcc-build/./gcc/ -
B/home/ckim/openrisc/toolchain/or32-linux/bin/ -B/home/ckim/openrisc/toolchain/or32-linux/lib/ -isystem 
/home/ckim/openrisc/toolchain/or32-linux/include -isystem /home/ckim/openrisc/toolchain/or32-linux/sys-include    -o 
conftest -g -O2   conftest.c  >&5
/home/ckim/openrisc/toolchain/gcc-build/./gcc/as: line 83: exec: : not found
configure:3023: $? = 1
configure:3211: checking for suffix of object files
configure:3233: /home/ckim/openrisc/toolchain/gcc-build/./gcc/xgcc -B/home/ckim/openrisc/toolchain/gcc-build/./gcc/ -
B/home/ckim/openrisc/toolchain/or32-linux/bin/ -B/home/ckim/openrisc/toolchain/or32-linux/lib/ -isystem 
/home/ckim/openrisc/toolchain/or32-linux/include -isystem /home/ckim/openrisc/toolchain/or32-linux/sys-include    -c -g -O2 
 conftest.c >&5
/home/ckim/openrisc/toolchain/gcc-build/./gcc/as: line 83: exec: : not found
configure:3237: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgcc/"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:3251: error: in `/home/ckim/openrisc/toolchain/gcc-build/or32-linux/libgcc':
configure:3254: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.

searching the message shows it may be related to not having gmp, mfpr, mpc library. It's Cento6.4. building outside the source, have LD_LIBRARY_PATH and LIBRARY_PATH have /usr/local/lib (for gmp, mpfr and mpc). tried adding --program-prefix=or32-linux, tried after removing all the files.. Can anyone give me some light on this?

1
ADD : I tried 'Doing it easy way' and it worked this time. But I still want to know the answer to my question.Chan Kim
for openrisc toolchain, you should follow the new version! opencores.org/or1k/… (read from Linux (uClibc) toolchain (or1k-linux-uclibc) )Chan Kim
With the new toolchaing that I mentioned above, everything is a breeze.Chan Kim

1 Answers

1
votes

Did you try using the included dependency script to bring the required libraries into the gcc build environment?

contrib/download_prerequisites

Much easier and less error prone doing it this way vs building the libraries externally and trying to point the gcc configuration at them.