#!/bin/sh # Reading system configuration informations, functions and package versions. source ../sysinfos source ../functions source ../packages-list cd ${LFS_TMP} # The linker, adjusted at the end of the first pass of Binutils, needs # to be renamed so that it can be properly found and used. if [ ! -f /tools/bin/ld-old -a -f /tools/bin/ld ]; then mv -v /tools/bin/{ld,ld-old} || exit 1 fi if [ ! -f /tools/$(gcc -dumpmachine)/bin/ld-old -a -f /tools/$(gcc -dumpmachine)/bin/ld ]; then mv -v /tools/$(gcc -dumpmachine)/bin/{ld,ld-old} || exit 1 fi rm -f /tools/$(gcc -dumpmachine)/bin/ld && cp -v -a /tools/bin/{ld-new,ld} && ln -sv /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld && # From this point onwards, everything will link only against the libraries # in /tools/lib. # Point GCC to the new dynamic linker. gcc -dumpspecs | sed 's@/lib/ld-linux.so.2@/tools&@g' \ > `dirname $(gcc -print-libgcc-file-name)`/specs && # Removing the header files in GCC's private include directory: GCC_INCLUDEDIR=`dirname $(gcc -print-libgcc-file-name)`/include && find ${GCC_INCLUDEDIR}/* -maxdepth 0 -xtype d -exec rm -rvf '{}' \; && rm -vf `grep -l "DO NOT EDIT THIS FILE" ${GCC_INCLUDEDIR}/*` && unset GCC_INCLUDEDIR && gcc_toolchain_test_stage1 # Return last error exit $?