This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
Re: Why does libc.so use absolute path?
- To: drepper@cygnus.com
- Subject: Re: Why does libc.so use absolute path?
- From: hjl@lucon.org (H.J. Lu)
- Date: Sun, 23 Aug 1998 07:13:30 -0700 (PDT)
- Cc: okuji@kuicr.kyoto-u.ac.jp, libc-alpha@cygnus.com
>
> OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp> writes:
>
> > Hello.
> >
> > I have a question: Why does libc.so in glibc-2.0.7pre5 use absolute
> > path instead of relative path? I want to use it both on a native
> > i586-gnu environment and on a cross i586-gnu environment, but if
> > libc.so is
>
Here is a script I use to copy a installed glibc 2 to a cross-compiler
installed at /opt/glibc-2.
H.J.
----
#! /bin/sh
if [ ! -x usr/bin/ldd ]; then
echo Invalid directory!
exit 1
fi
case $1 in
2.0)
dir=/opt/glibc-2.0
;;
2.1)
dir=/opt/glibc-2.1
;;
*)
echo Invalid version!
exit 1
;;
esac
rm -rf $dir
mkdir -p $dir/bin
sed -e "s,RTLD=\([.]*\),RTLD=/opt/glibc-2\1," usr/bin/ldd > $dir/bin/gldd
chmod 755 $dir/bin/gldd
cp -a lib usr/include usr/lib $dir
rm -rf $dir/lib/terminfo
cd $dir
ln -s ../glibc-2-dev/i586-unknown-linux-gnu .
cd include
ln -s /usr/include/asm .
ln -s /usr/include/linux .
cd $dir/bin
ln -s ../../glibc-2-dev/bin/gcc-glibc2 .
cd $dir/lib
ln -s ../../glibc-2-dev/lib/gcc-lib .
#ldconfig .
for f in lib*.so
do
case $f in
libtermcap.so|libcurses.so|libndbm.so)
;;
*-*.so)
;;
libc.so)
rm -f $f
cat > $f <<EOF
/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
GROUP ( /opt/glibc-2/lib/libc.so.6 /opt/glibc-2/lib/libc_nonshared.a )
EOF
;;
*)
rm -f $f
ln -s $f.* $f
;;
esac
done