--- crosstool-0.37/crosstool.sh.orig 2005-07-11 17:00:02.000000000 +0100 +++ crosstool-0.37/crosstool.sh 2005-07-11 17:02:10.000000000 +0100 @@ -649,8 +649,34 @@ then cd build-glibc make LD=${TARGET}-ld RANLIB=${TARGET}-ranlib - # note: should do full install and then fix linker scripts, but this is faster - make install_root=${SYSROOT} $GLIBC_SYSROOT_ARG install-bin install-rootsbin install-sbin install-data install-others + make install install_root=${SYSROOT} $GLIBC_SYSROOT_ARG + + # Fix problems in linker scripts. + # + # 1. Remove absolute paths + # Any file in a list of known suspects that isn't a symlink is assumed to be a linker script. + # FIXME: test -h is not portable + # FIXME: probably need to check more files than just these three... + # Need to use sed instead of just assuming we know what's in libc.so because otherwise alpha breaks + # But won't need to do this at all once we use --with-sysroot (available in gcc-3.3.3 and up) + # + # 2. Remove lines containing BUG per http://sources.redhat.com/ml/bug-glibc/2003-05/msg00055.html, + # needed to fix gcc-3.2.3/glibc-2.3.2 targeting arm + # + # To make "strip *.so.*" not fail (ptxdist does this), rename to .so_orig rather than .so.orig + for file in libc.so libpthread.so libgcc_s.so; do + for lib in lib lib64 usr/lib usr/lib64; do + if test -f ${SYSROOT}/$lib/$file && test ! -h ${SYSROOT}/$lib/$file; then + mv ${SYSROOT}/$lib/$file ${SYSROOT}/$lib/${file}_orig + if test -z "$USE_SYSROOT"; then + sed 's,/usr/lib/,,g;s,/usr/lib64/,,g;s,/lib/,,g;s,/lib64/,,g;/BUG in libc.scripts.output-format.sed/d' < ${SYSROOT}/$lib/${file}_orig > ${SYSROOT}/$lib/$file + else + sed '/BUG in libc.scripts.output-format.sed/d' < ${SYSROOT}/$lib/${file}_orig > ${SYSROOT}/$lib/$file + fi + fi + done + done + cd .. fi