mirror of
https://git.adityakumar.xyz/lfs-scripts.git
synced 2024-12-22 15:22:56 +00:00
Add 6.18 - Build gcc
This commit is contained in:
parent
0f1e1fa648
commit
01e0770bbb
2 changed files with 75 additions and 2 deletions
61
scripts/chapter6/6.18-gcc.sh
Normal file
61
scripts/chapter6/6.18-gcc.sh
Normal file
|
@ -0,0 +1,61 @@
|
|||
#!/bin/bash
|
||||
|
||||
cd $LFS/sources
|
||||
tar xf gcc-12.2.0.tar.xz
|
||||
cd gcc-12.2.0
|
||||
|
||||
tar -xf ../mpfr-4.1.0.tar.xz
|
||||
mv -v mpfr-4.1.0 mpfr
|
||||
tar -xf ../gmp-6.2.1.tar.xz
|
||||
mv -v gmp-6.2.1 gmp
|
||||
tar -xf ../mpc-1.2.1.tar.gz
|
||||
mv -v mpc-1.2.1 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 -v 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-initfini-array \
|
||||
--disable-nls \
|
||||
--disable-multilib \
|
||||
--disable-decimal-float \
|
||||
--disable-libatomic \
|
||||
--disable-libgomp \
|
||||
--disable-libquadmath \
|
||||
--disable-libssp \
|
||||
--disable-libvtv \
|
||||
--enable-languages=c,c++
|
||||
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make -j5
|
||||
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make DESTDIR=$LFS install
|
||||
|
||||
ln -sv gcc $LFS/usr/bin/cc
|
||||
|
||||
cd $LFS/sources
|
||||
rm -rf gcc-12.2.0
|
|
@ -373,8 +373,8 @@ fi
|
|||
|
||||
# Chapter 6.17
|
||||
# ============
|
||||
echo "Building 6.18"
|
||||
su - lfs -c "$PWD/chapter6/6.17-binutils.sh"
|
||||
echo "Building binutils pass 2"
|
||||
su - lfs -c "bash $PWD/chapter6/6.17-binutils.sh"
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
|
@ -383,3 +383,15 @@ then
|
|||
stop_script "chapter6/6.17-binutils.sh"
|
||||
fi
|
||||
|
||||
# Chapter 6.18
|
||||
# ============
|
||||
echo "Building gcc pass 2"
|
||||
su - lfs -c "bash $PWD/chapter6/6.18-gcc.sh"
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter6/6.18-gcc.sh"
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue