X-Git-Url: https://hackdaworld.org/gitweb/?p=hdw-linux%2Fhdw-linux.git;a=blobdiff_plain;f=packages%2Ftoolchain%2Fbinutils%2Fbinutils;h=94381d2683aee189c13abb3841e2067abf523325;hp=08e3bc037e30482727e2a4015cc36257cfc3fe1c;hb=8dd2356c22327a15f0e16abbc887c4f72fc62985;hpb=6ae193981fcc05dcc495b4bde92cb8fd290ee4dd diff --git a/packages/toolchain/binutils/binutils b/packages/toolchain/binutils/binutils index 08e3bc0..94381d2 100644 --- a/packages/toolchain/binutils/binutils +++ b/packages/toolchain/binutils/binutils @@ -2,63 +2,69 @@ # # author: hackbard@hackdaworld.dyndns.org # -# [V] 2.15.91.0.1 +# [V] 2.17 # [S] 0-1 0-4 0-5 -# [D] binutils-2.15.91.0.1.tar.bz2 http://ftp.kernel.org/pub/linux/devel/binutils/ +# [D] binutils-2.17.tar.bz2 http://ftp.gnu.org/gnu/binutils/ if [ "$priority" = "1" ] ; then - confopt=${confopt//--host* /--host=$hdw_arch_build } confopt="$confopt --disable-nls" - # use host system tools - hdw_arch_prefix="" - . ./scripts/optimization - unset CFLAGS - make_conf="LDFLAGS=-all-static" libpath="$prefix/lib" + echo "libpath = $libpath" fi if [ "$priority" = "4" ] ; then custmain=1 custmain() { - # install binutils linking against new libc - cd $root/tmp/src.binutils/binutils-build - make -C ld install - cd - - rm -rf $root/tmp/src.binutils + # install the ld linking against toolchain libc + mv -v $prefix/bin/{ld,ld-old} + mv -v $prefix/`gcc -dumpmachine`/bin/{ld,ld-old} + mv -v $prefix/bin/{ld-new,ld} + ln -sfv $prefix/bin/ld $prefix/`gcc -dumpmachine`/bin/ld # show new linker to gcc - SPECFILE=$prefix/lib/gcc-lib/*/*/specs && + SPECFILE="`gcc -print-libgcc-file-name`" + SPECFILE="`dirname $SPECFILE`/specs" + gcc -dumpspecs | sed -e "s@/lib/ld.so.1@$prefix/lib/ld.so.1@g" \ - -e "s@/lib/ld-linux.so.2@$prefix/lib/ld-linux.so.2@g" \ - $SPECFILE > tempspecfile - mv tempspecfile $SPECFILE + -e "s@/lib/ld-linux.so.2@$prefix/lib/ld-linux.so.2@g" > \ + $SPECFILE + echo "debug: (specfile ->$SPECFILE)" + cp -v $SPECFILE $hdw_home_dir + cat $SPECFILE + echo "debug: (gcc -dumpspecs)" + gcc -dumpspecs + + INCDIR="`dirname $SPECFILE`/include" unset SPECFILE - rm -f $prefix/lib/gcc-lib/*/*/include/pthread.h - rm -f $prefix/lib/gcc-lib/*/*/include/bits/sigthread.h + + # remove fixed includes from gcc's private include dir + find $INCDIR/* -maxdepth 0 -xtype d -exec rm -rvf '{}' \; + rm -vf `grep -l "DO NOT EDIT THIS FILE" $INCDIR/*` + unset INCDIR } fi if [ "$priority" = "5" ] ; then - confopt="$confopt --enable-shared --with-lib-path=$prefix/lib" - make_conf="" - libpath="/usr/lib:/lib" + confopt="$confopt --disable-nls --with-lib-path=$prefix/lib" + if [ "$hdw_crossbuild" = "0" ] ; then + libpath="/usr/lib:/lib" + else + libpath="$root/usr/lib:$root/lib" + fi fi build_main() { mkdir -p ../binutils-build cd ../binutils-build ../binutils-${ver}/configure $confopt && - [ "$priority" = "1" ] && make configure-host make $make_conf && - make install + make $install_conf install } post_install() { - # linkers default library path (where our glibc will go) + # build ld-new with changed linkers default library search path + # (glibc will go there) make -C ld clean - make -C ld $make_conf LIB_PATH=$libpath - # __very__ ___ugly___ - # store binutils tree to reinstall after glibc build - cd $root && mkdir -p tmp - rm -rf tmp/src.binutils && mv src.binutils tmp/ + make -C ld LIB_PATH=$libpath + cp -v ld/ld-new $prefix/bin }