This is the mail archive of the libc-alpha@cygnus.com mailing list for the glibc project.


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

Re: Why does libc.so use absolute path?


> 
> 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


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