This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


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

Re: ld giving problems when trying to build a cross-compiler.


I used the following for binutils:

../binutils-2.10.1/configure --host=$HOST --target=$TARGET
--prefix=/opt/cross-alpha

Where HOST=i686-linux and TARGET=alpha-linux

Then ran gmake, gmake install. There is no problem there, it's only
when trying to build gcc (with same options I get the problem).
I also tried a different approach where I build gcc-core first, which
works, then build glibc, but again configure (of glibc this time)
complains that ld cannot find libc.so.6.1.

Attached is the script equivalent of what I first tried to do. Which
are about the same as in the Cross-FAQ.

On Apr 23,  8:04pm, Andreas Jaeger wrote:
> Subject: Re: ld giving problems when trying to build a cross-compiler.
> Richard Lefebvre <rick@CERCA.UMontreal.CA> writes:
>
> > Hi,
> > I'm trying to build a cross-compiler hosted on a linux-iX86 for a target
> > alpha-linux and ld is preventing me from going anywhere it complains that
> > it cannot find /lib/crt0.o. I fixed that problem by getting crt*.o from
> > RedHat alpha distribution an putting it in the $prefix/$target/lib
> > (prefix and target as defined in the configure --prefix --target).
> > Then ld ask for /lib/libc.so.6.1, I copy the files (same thing I've done
> > for crt0.o) but that doesn't solve the problem.
> >
> > What could I have done wrong? Is there something more I could put in
> > configure of binutils?
>
> How did you run configure?
>
> Andreas
> --
>  Andreas Jaeger
>   SuSE Labs aj@suse.de
>    private aj@arthur.inka.de
>     http://www.suse.de/~aj
>-- End of excerpt from Andreas Jaeger



-- 
Richard Lefebvre, Sys-admin, CERCA, (514)369-5224            "Don't Panic"
Richard.Lefebvre(@AROBAS)cerca(.POINT)umontreal(.POINT)ca       -- THGTTG
http://www.CERCA.UMontreal.CA/~rick/
#!/bin/sh
TARGETDIR=/opt/cross-alpha
TARGET=alpha-linux

# Installing Linux Redhat alpha RPMs in TARGETDIR
# Assuming that RPMs are allready in TARGETDIR/RPMS
mkdir -p $TARGETDIR/var/lib/rpm
cd $TARGETDIR/RPMS
RPMCOMMAND="rpm --ignorearch --nodeps --noscripts --notriggers --root $TARGETDIR -ivh"
$RPMCOMMAND kernel-headers-2.2.14-6.0.alpha.rpm
$RPMCOMMAND glibc-2.1.3-16.alpha.rpm
$RPMCOMMAND glibc-devel-2.1.3-16.alpha.rpm
# because of --noscripts --notriggers the following link is missing
cd $TARGETDIR/usr/src
ln -s linux-2.2.14/ linux

# making links to installed RPM
# The includes...
mkdir -p $TARGETDIR/$TARGET
cd $TARGETDIR/$TARGET
ln -s ../usr/include include

# The object files *crt*.o libc*
mkdir -p $TARGETDIR/$TARGET/lib
cd $TARGETDIR/$TARGET/lib
ln -s ../../usr/lib/* .
ln -s ../../lib/* .

# creation of directory so gcc go down into the directory and ../../../.. back up
mkdir -p $TARGETDIR/lib/gcc-lib/alpha-linux/2.95.3

PATH=$TARGETDIR/bin:$PATH
export PATH

# Now building stuff
# Assuming that the sources have already been untared in TARGETDIR/SRC
SRCBINUTILS=binutils-2.10.1
SRCGCC=gcc-2.95.3
SRCLIBC=glibc-2.1.3
cd $TARGETDIR/SRC

mkdir -p $TARGETDIR/SRC/Build-binutils
cd $TARGETDIR/SRC/Build-binutils
../$SRCBINUTILS/configure --target=alpha-linux --prefix=/opt/cross-alpha -v
make all install

mkdir -p $TARGETDIR/SRC/Build-gcc
cd $TARGETDIR/SRC/Build-gcc
../$SRCGCC/configure --target=alpha-linux --prefix=/opt/cross-alpha -v
make all install

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