This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Help with ppc-linux cross


Will Sloan wrote:

> > Where did these include files come from ?  A glibc distribution ?
> >
>
> Yes.  I got them from glibc2.1
>
> > I haven't seen this problem but make sure that you have the following.
> > 1) preinstalled include files from a powerpc distribution to
> > $prefix/$target/include
> > 2) preinstalled library files from a powerpc distribution to $prefix$target/lib
>
> I'm trying to build the compiler so then I can build the libs.  Is the problem that
> I need the libs to build the cross compiler and I need the cross compiler to build
> the libs??

Yep.  It's  a chicken and egg problem.  I'm pretty sure you can build the C compiler
only without the runtime libs.  You can then build the runtime libs with this
compiler.  Once this is done you should be able to build all the other GCC components
such as C++, fortran, etc.

If you preinstall some runtime libs from a powerpc system, then you can build all the
GCC components at once, then rebuild the runtime libs.  The preinstalled runtime libs
don't even have to be the ones for your target system, just as long as the GCC can
find some runtime libs.  eg. I used the yellowdog linux glibc libraries which were
pointed out to me by Kai Ruottu.  Here are his instructions.

http://www.yellowdoglinux.com/

ftp://rpmfind.net/linux/yellowdog/champion-1.0/ppc/RedHat/RPMS/
- glibc-2.1-1a.ppc.rpm
- glibc-devel-2.1-1a.ppc.rpm

Use rpm and cpio to extract the files into a temporary directory.
$ rpm2cpio glibc-2.1-1a.ppc.rpm > glibc-2.1-1a.ppc.cpio
$ rpm2cpio glibc-devel-2.1-1a.ppc.rpm > glibc-devel-2.1-1a.ppc.cpio
$ cpio -iBdmv < glibc-2.1-1a.ppc.rpm
$ cpio -iBdmv < glibc-devel-2.1-1a.ppc.rpm

After copying all the "lib/..." stuff into "usr/lib" and fixing the
symbolic links in "usr/lib" (those pointing to ../../lib) to point to
the files in the same directory, move the stuff from "usr/lib" and
"usr/include" to $prefix/$target/lib and $prefix/$target/lib
directories.

Probably need to fix the "-dynamic-linker" statement in the specs file
($prefix/lib/gcc-lib/$target/$egcs-version/specs) to be "-dynamic-linker
$prefix/$target/lib/ld.so.1".

Also need to edit $prefix/$target/lib/libc.so.  Change /usr/lib to
$prefix/$target/lib.

Cheers,
Brendan Simon.



------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]