I see ar, ranlib and strip have been picked up from the binutils
directory though the error is exactly the same as before - line 83
exec not found (what exec id doesn't say). So, I presume I have to
build binutils first and place the executables in prefix/target/bin,
right?
Yes, which should happen automatically if you configure the binutils
with the identical --target and --prefix options that you use when you
configure gcc. When you run "make; make install" the binutils should be
installed where gcc expects to find them.
OK, I've just successfully compiled and installed binutils for x86_64 ->
ppc with prefix ~/gcc-test/gcc-install. I then ran a (modified)
configure for gcc with the same prefix. Configure picked up the right
binaries this time, I think:
checking for ar... /home/mz/gcc-test/gcc-install/powerpc-redhat-linux/bin/ar
checking for as... /home/mz/gcc-test/gcc-install/powerpc-redhat-linux/bin/as
checking for dlltool... no
checking for powerpc-redhat-linux-dlltool... no
checking for ld... /home/mz/gcc-test/gcc-install/powerpc-redhat-linux/bin/ld
checking for lipo... no
checking for powerpc-redhat-linux-lipo... no
checking for nm... /home/mz/gcc-test/gcc-install/powerpc-redhat-linux/bin/nm
checking for objdump...
/home/mz/gcc-test/gcc-install/powerpc-redhat-linux/bin/objdump
checking for ranlib...
/home/mz/gcc-test/gcc-install/powerpc-redhat-linux/bin/ranlib
checking for strip...
/home/mz/gcc-test/gcc-install/powerpc-redhat-linux/bin/strip
checking for windres... no
checking for powerpc-redhat-linux-windres... no
checking for windmc... no
checking for powerpc-redhat-linux-windmc... no
checking where to find the target ar... pre-installed in
/home/mz/gcc-test/gcc-install/powerpc-redhat-linux/bin
checking where to find the target as... pre-installed in
/home/mz/gcc-test/gcc-install/powerpc-redhat-linux/bin
checking where to find the target cc... just compiled
checking where to find the target c++... just compiled
checking where to find the target c++ for libstdc++... just compiled
checking where to find the target dlltool... pre-installed
checking where to find the target gcc... just compiled
checking where to find the target gcj... pre-installed
checking where to find the target gfortran... just compiled
checking where to find the target ld... pre-installed in
/home/mz/gcc-test/gcc-install/powerpc-redhat-linux/bin
checking where to find the target lipo... pre-installed
checking where to find the target nm... pre-installed in
/home/mz/gcc-test/gcc-install/powerpc-redhat-linux/bin
checking where to find the target objdump... pre-installed in
/home/mz/gcc-test/gcc-install/powerpc-redhat-linux/bin
checking where to find the target ranlib... pre-installed in
/home/mz/gcc-test/gcc-install/powerpc-redhat-linux/bin
checking where to find the target strip... pre-installed in
/home/mz/gcc-test/gcc-install/powerpc-redhat-linux/bin
checking where to find the target windres... pre-installed
checking where to find the target windmc... pre-installed
I see dlltool, lipo, windres, windmc and gcj as 'pre-installed', i.e.
using my host machine versions (if indeed that is the case).
When I ran make next I went much further than before, but, ultimately
failed again with the following error:
/home/mz/gcc-test/gcc-build/./gcc/xgcc
-B/home/mz/gcc-test/gcc-build/./gcc/
-B/home/mz/gcc-test/gcc-install/powerpc-redhat-linux/bin/
-B/home/mz/gcc-test/gcc-install/powerpc-redhat-linux/lib/ -isystem
/home/mz/gcc-test/gcc-install/powerpc-redhat-linux/include -isystem
/home/mz/gcc-test/gcc-install/powerpc-redhat-linux/sys-include -O2 -g
-pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4
-O2 -O2 -g -pipe -Wall -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall
-Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition -isystem ./include -fPIC -g -DHAVE_GTHR_DEFAULT
-DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -mlong-double-128
-I. -I. -I../.././gcc -I../../../gcc/libgcc -I../../../gcc/libgcc/.
-I../../../gcc/libgcc/../gcc -I../../../gcc/libgcc/../include
-I../../../gcc/libgcc/../libdecnumber/dpd
-I../../../gcc/libgcc/../libdecnumber -DHAVE_CC_TLS -o decContext.o -MT
decContext.o -MD -MP -MF decContext.dep -c
../../../gcc/libgcc/../libdecnumber/decContext.c
../../../gcc/libgcc/../libdecnumber/decContext.c:33:43: fatal error:
string.h: No such file or directory
compilation terminated.
make[2]: *** [decContext.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory
`/home/mz/gcc-test/gcc-build/powerpc-redhat-linux/libgcc'
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory `/home/mz/gcc-test/gcc-build'
make: *** [all] Error 2
By quickly looking at decContext.c it references <string.h> on line 33.
Quick search tells me that there is only one file named string.h in the
source tree and it is located at
./gcc-test/gcc/libstdc++-v3/include/c_compatibility/string.h. I am not
sure whether that is the right place for it or whether that is indeed
the right version of the file. Any ideas how to get pass this?
One other thing I discovered - I could place gmp, mpc, mpfr and ppl (but
*not* cloog) sources in the binutils source tree and "make" picks them
up, though I later on had to do the same with gcc, otherwise the build
fails (I guess I was hoping that once built by binutils these packages
will be installed by binutils and later used by gcc - I was wrong).