GCC First Pass – 5.3

I forgot to write down the time for the SBU for 5.2. It was between 5 and 10 minutes. I’d decided not to include the time in the configure command to simplify it, and then I got distracted.

In that case however, let’s say it was 10 minutes, then this GCC as 3.2 SBU would have taken 32 minutes with one core. Actual time was 1 hour 5 minutes.

I couldn’t find in my own documentation notes what I’d done about using all cores, and had to ask it, and then put off changing the environment back to one core until next time.

Other than that this went well.

To create the procedure, I started with the template that I made from the AI’s rendition of the final procedure from 5.2. So I started using some of its wording and typography. Labeling each step with what it is supposed to do is much better than how I was doing my notes.

5.3 GCC-14.2.0 Pass 1

The GCC package contains the GNU compiler collection, which includes the C and C++ compilers

#1. Log in as LFS user
su – lfs

Check MAKEFLAGS
echo $MAKEFLAGS
-j4

#2. Go to source directory

cd $LFS/sources

#3. Extract the source code

tar -xJf gcc-14.2.0.tar.xz

#4. Move into the extracted folder

cd gcc-14.2.0

4a. Unpack and rename the GMP, MPFR, and MPC packages

tar -xf ../mpfr-4.2.1.tar.xz

mv -v mpfr-4.2.1 mpfr

tar -xf ../gmp-6.3.0.tar.xz

mv -v gmp-6.3.0 gmp

tar -xf ../mpc-1.3.1.tar.gz

mv -v mpc-1.3.1 mpc

4b. Set the default directory name for 64-bit libraries to “lib”

sed -e ‘/m64=/s/lib64/lib/’ -i.orig gcc/config/i386/t-linux64

#5. Create a separate build area

mkdir -v build

#6. Step into the build area

cd build

# 7. Configure, compile, install, and log everything

../configure –target=$LFS_TGT –prefix=$LFS/tools –with-glibc-version=2.41 –with-sysroot=$LFS –with-newlib –without-headers –enable-default-pie –enable-default-ssp –disable-nls –disable-shared –disable-multilib –disable-threads –disable-libatomic –disable-libgomp –disable-libquadmath –disable-libssp –disable-libvtv –disable-libstdcxx –enable-languages=c,c++ && make -j1 && make install 2>&1 | tee gcccommand.txt

# 8. Open file using tail, scroll to the bottom of the log

tail -n 20 gcccommand.txt

Copy your log out of the temporary folder so it isn’t deleted

cp gcccommand.txt $LFS/sources/

Look in target directory

ls -l $LFS/tools/bin

# 9.

9a. Move up from build to gcc-14.2.0

cd ..

9b. Create a full version of the internal header

cat gcc/limitx.h gcc/glimits.h gcc/limity.h > `dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/include/limits.h

There will be a file something like

/mnt/lfs/tools/lib/gcc/x86_64-lfs-linux-gnu/14.2.0/include/limits.h

9d. Jump back up to the main sources directory

cd $LFS/sources

# 10. Completely wipe out the temporary workspace

rm -rfv gcc-14.2.0