end of Ch6 tools

This commit is contained in:
YellowJacketLinux 2024-10-01 22:07:47 -07:00
parent 915ef48ec4
commit dcc3acdcdc
2 changed files with 178 additions and 0 deletions

49
CH06.16-binutils-pass2.sh Normal file
View File

@ -0,0 +1,49 @@
#!/bin/bash
source versions.sh
GLSOURCES="${LFS}/sources"
if [ "`whoami`" != "lfs" ]; then
myfail "Must run this script as lfs user"
fi
pushd $GLSOURCES > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
[ -d binutils-${binutils_version} ] && rm -rf binutils-${binutils_version}
tar -Jxf ${binutils_tarball}
cd binutils-${binutils_version}
sed '6009s/$add_dir//' -i ltmain.sh
mkdir build && cd build
../configure --prefix=/usr \
--build=$(../config.guess) \
--host=${LFS_TGT} \
--disable-nls \
--enable-shared \
--enable-gprofng=no \
--disable-werror \
--enable-64-bit-bfd \
--enable-new-dtags \
--enable-default-hash-style=gnu
make
if [ $? -ne 0 ]; then
myfail "Failed building binutils"
fi
make DESTDIR=${LFS} install
if [ $? -ne 0 ]; then
myfail "Failed installing binutils"
fi
rm -v ${LFS}/usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes,sframe}.{a,la}

129
CH06.17-gcc-pass2.sh Normal file
View File

@ -0,0 +1,129 @@
#!/bin/bash
# FIXME - go and objc
source versions.sh
GLSOURCES="${LFS}/sources"
if [ "`whoami`" != "lfs" ]; then
myfail "Must run this script as lfs user"
fi
pushd $GLSOURCES > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
[ -d gcc-${gcc_version} ] && rm -rf gcc-${gcc_version}
tar -Jxf ${gcc_tarball}
cd gcc-${gcc_version}
tar -xf ../${mpfr_tarball}
mv mpfr-${mpfr_version} mpfr
tar -xf ../${gmp_tarball}
mv gmp-${gmp_version} gmp
tar -xf ../${mpc_tarball}
mv mpc-${mpc_version} mpc
case $(uname -m) in
x86_64)
sed -e '/m64=/s/lib64/lib/' \
-i.orig gcc/config/i386/t-linux64
;;
esac
sed '/thread_header =/s/@.*@/gthr-posix.h/' \
-i libgcc/Makefile.in libstdc++-v3/include/Makefile.in
mkdir build && cd build
tar -xf ../${mpfr_tarball}
mv mpfr-${mpfr_version} mpfr
tar -xf ../${gmp_tarball}
mv gmp-${gmp_version} gmp
tar -xf ../${mpc_tarball}
mv mpc-${mpc_version} mpc
case $(uname -m) in
x86_64)
sed -e '/m64=/s/lib64/lib/' \
-i.orig gcc/config/i386/t-linux64
;;
esac
sed '/thread_header =/s/@.*@/gthr-posix.h/' \
-i libgcc/Makefile.in libstdc++-v3/include/Makefile.in
mkdir build && cd build
tar -xf ../${mpfr_tarball}
mv mpfr-${mpfr_version} mpfr
tar -xf ../${gmp_tarball}
mv gmp-${gmp_version} gmp
tar -xf ../${mpc_tarball}
mv mpc-${mpc_version} mpc
case $(uname -m) in
x86_64)
sed -e '/m64=/s/lib64/lib/' \
-i.orig gcc/config/i386/t-linux64
;;
esac
sed '/thread_header =/s/@.*@/gthr-posix.h/' \
-i libgcc/Makefile.in libstdc++-v3/include/Makefile.in
mkdir build && cd build
tar -xf ../${mpfr_tarball}
mv mpfr-${mpfr_version} mpfr
tar -xf ../${gmp_tarball}
mv gmp-${gmp_version} gmp
tar -xf ../${mpc_tarball}
mv mpc-${mpc_version} mpc
case $(uname -m) in
x86_64)
sed -e '/m64=/s/lib64/lib/' \
-i.orig gcc/config/i386/t-linux64
;;
esac
sed '/thread_header =/s/@.*@/gthr-posix.h/' \
-i libgcc/Makefile.in libstdc++-v3/include/Makefile.in
mkdir build && cd build
../configure \
--build=$(../config.guess) \
--host=${LFS_TGT} \
--target=${LFS_TGT} \
LDFLAGS_FOR_TARGET=-L$PWD/$LFS_TGT/libgcc \
--prefix=/usr \
--with-build-sysroot=${LFS} \
--enable-default-pie \
--enable-default-ssp \
--disable-nls \
--disable-multilib \
--disable-libatomic \
--disable-libgomp \
--disable-libquadmath \
--disable-libsanitizer \
--disable-libssp \
--disable-libvtv \
--enable-languages=c,c++
make
if [ $? -ne 0 ]; then
myfail "Failed building gcc pass2"
fi
make DESTDIR=${LFS} install
if [ $? -ne 0 ]; then
myfail "Failed installing gcc pass2"
fi
ln -sv gcc $LFS/usr/bin/cc