The GCC package contains the GNU compiler collection, which includes the C and C++ compilers.
Download HTTP: https://mirror.csclub.uwaterloo.ca/gnu/gcc/gcc-15.2.0/gcc-15.2.0.tar.xz
Download SHA256 Sum: 438fd996826b0c82485a29da03a72d71d6e3541a83ec702df4271f6fe025d24e
Download Size: 98,688 KB
Estimated Disk Space: 3.9G
Estimated Build Time: 17.00 SBU
Xz-5.8.3, GCC-15.2.0-pass1, Binutils-2.46.0-pass2, glibc-2.43, and Linux-7.0.3-headers
Prepare GCC-pass2 for compilation:
tar -xf ../gmp-6.3.0.tar.xz && mv -v gmp-6.3.0 gmp
tar -xf ../mpc-1.4.0.tar.xz && mv -v mpc-1.4.0 mpc
tar -xf ../mpfr-4.2.2.tar.xz && mv -v mpfr-4.2.2 mpfr
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
Now Configure the Package, issue:
mkdir -v build
cd build
../configure --prefix=/usr \
--host=$LFS_TGT \
--target=$LFS_TGT \
--build=$(../config.guess) \
--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++ \
LDFLAGS_FOR_TARGET=-L$PWD/$LFS_TGT/libgcc
To Compile the Package, issue:
make
Now Install the Package, issue:
make DESTDIR=$LFS install ln -sv gcc $LFS/usr/bin/cc