Németh Márton wrote:
Hi,
I'm trying to build a gcc cross compiler for target powerpc-linux-gnuspe.
The binutils bulds without any problem but I'm not sure why building gcc
fails.
On the contrary your GCC build succeeded ! How else you could have
'xgcc', 'cc1', 'collect2' etc.
which are just the GCC parts?
$ ../gcc-4.4.2/configure --target=powerpc-linux-gnuspe --prefix=/home/nmarci/usr/local/gcc --disable-shared --disable-threads --enable-languages=c
$ make
The 'make' means 'make all', the default "GCC build" doesn't mean the
same as 'make all-gcc' !
checking for suffix of object files... configure: error: in `/usr/src/gcc-build/powerpc-linux-gnuspe/libgcc':
The 'libgcc' is the GCC helper library built for the $target USING the
"ready-to-run" new GCC.
So you have your new GCC ready and can use it to compile all kind of
things like a Linux kernel
and here the 'libgcc' library!
So what's wrong with the procedure?
You seemingly didn't read my earlier reply where I told : "and then
configuring GCC and making
& installing it using 'make all-gcc ; make install-gcc', should
work..." What was unclearly said in
this?
Compiling and linking things with a target compiler requires headers and
libraries for this target,
in this case for Linux/PPC, the "native" headers (in '/usr/include') and
libraries (in '/lib' and '/usr/lib')
are for the native, Linux/x86 or Linux/x86_64 assumed, target. and
therefore not 'suitable'.
If you really want to produce libraries and applications for
'powerpc-linux-gnuspe', then you must
have a proper glibc made for that! Producing GCC then expects this
existing already. But for
just the SPE-variation there probably aren't any freely downloadable
glibcs. But for the generic
Linux/PPC there are many like the Fedora/PPC and OpenSuSE/PPC distros.
One could build
a complete "GCC" with 'libgcc', 'libstdc++' etc. with one of them as the
"bootstrap" glibc. But
after that you must produce a proper glibc for Linux/PPC-SPE with the
new "complete" GCC.
This already has its 'libgcc' etc. libs made for the $target,
'powerpc-linux-gnuspe' but the base
glibc is for the generic 'powerpc-linux-gnu'... Quite surely the
generic code in the bootstrap
glibc would work in a SPE CPU but not being very "optimal"....
You told that you will need ONLY a "kernel compiler", and making this
has already succeeded!
Just write :
make install-gcc
and see whether it will succeed! Producing a "complete compiler"
with a C library is then
much more complicated issue as you could see from the previous :(
Regards,
Márton Németh