# gcc920/cfg - "Build" settings for package #--------------------------------------------------------------------- [technotes] 1. "gcc920" builds "gcc" 9.2.0. #--------------------------------------------------------------------- 2. Presently, "gcc920" (gcc 9.2.0) is needed, and used, to build it- self. If you're porting this distro to a new architecture, you may be able to use a different distro's copy of "gcc" 8.X or 9.X to bootstrap this distro's copy of "gcc" 9.2.0. The details are beyond the scope of this discussion. If you use "gcc920" to rebuild itself, it's strongly recommended that you back-up the package first. #--------------------------------------------------------------------- 3. This release of "gcc" isn't intended to serve as the default 'C' or C++ compiler for this distro. #--------------------------------------------------------------------- 4. The executables stored in this package's main "bin" directory shouldn't be compressed (i.e., using "upx" or a similar program). If this is done, the distro's compiler wrapper won't be able to operate correctly. It's also a bad idea to compress executables stored in this package's other directories. In theory, this should work. In practice, it pro- duces a slow compiler. #--------------------------------------------------------------------- [buildtimes] 00.21 hours (or 012.78 minutes) - HP EliteBook 8560w 32GB RAM 00.28 hours (or 017.05 minutes) - ThinkPad E540 i7 4x2 16GB RAM 00.31 hours (or 018.80 minutes) - 2023 dedi Xeon E3-1200 v3 4x2 32GB RAM 00.39 hours (or 023.13 minutes) - ThinkPad W530 i7 4x2 32GB RAM 00.71 hours (or 042.32 minutes) - ThinkPad W530 i7 4x2 32GB RAM using a 64-bit kernel and 32-bit distro #--------------------------------------------------------------------- [settings] configure = none # Handled during "build" stage license = See "license*.txt" in installed tree licfile = COPYING nodebug = yes nosyslinks = yes # Disable normal integration nowerror = yes purge = no # This is a critical package tmpsize = 848M unpack = relaxed #--------------------------------------------------------------------- [depends] actools:forward bison:forward chrpath:forward flex:forward gawk:forward grep:forward none #--------------------------------------------------------------------- [build] #--------------------------------------------------------------------- # Initial setup. GCCTRIPLE=9.2.0 PATH=$PRODTREE/gcc920/bin:$PATH #--------------------------------------------------------------------- if [ "x$LACARCH" == "x" ]; then echo Error: LACARCH not set exit 1 fi if [ "x$LACSYSTREE" == "x" ]; then echo Error: LACSYSTREE not set exit 1 fi sed -e 's@__META_SYSTREE__@$LACSYSTREE@' \ -i gcc/cppdefault.c gcc/collect2.c gcc/config/i386/linux64.h date && echo Start echo Compiling with: hash gcc g++ gcc --version rm -fr /usr/lib64/*.a mkdir -p /usr/lib64 for x in libc.so libpthread.so do FX=/usr/lib64/$x if [ -f $FX ]; then echo Error: $FX exists exit 1 fi done #--------------------------------------------------------------------- SUPLIB=$PKGDIR_SPECIAL/suplib tar Jxf $SUPLIB/gmp-6.1.2.tar.xz tar Jxf $SUPLIB/isl-0.18.tar.xz tar zxf $SUPLIB/mpc-1.1.0.tar.gz tar jxf $SUPLIB/mpfr-3.1.6.tar.bz2 mv gmp{-6.1.2,} mv isl{-0.18,} mv mpc{-1.1.0,} mv mpfr{-3.1.6,} #--------------------------------------------------------------------- # This step is from BFLS and/or Slackware. # sed -e '/m64=/s/lib64/lib/' \ -i gcc/config/i386/t-linux64 # From BLFS: # sed -e 's@\./fixinc\.sh@-c true@' \ -i gcc/Makefile.in #--------------------------------------------------------------------- treetextsub \ --pattern="/usr/lib64" \ --newtext="$LACSYSTREE/lib" --keeptimes treetextsub \ --pattern="/usr/lib" \ --newtext="$LACSYSTREE/lib" --keeptimes #--------------------------------------------------------------------- BINDIR=$PKGDIR_PROD/bin LIBDIR=$PKGDIR_PROD/lib mkdir -p $BINDIR $LIBDIR #--------------------------------------------------------------------- # The "chown/chmod" commands used here are based partly on Slackware # recommendations. chown -R 0.0 . find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 754 -exec chmod 755 {} \; # Skip this one. It's too slow for some releases of gcc: # # find . -perm 664 -print -exec chmod 644 {} \; #--------------------------------------------------------------------- SDIR=`pwd` cd .. mkdir obj cd obj XDIR=`pwd` #--------------------------------------------------------------------- export FORCEPATHMAX=yes PREFIX=$PKGDIR_PROD mkdir -p $PREFIX/lib export TEMPDIR=/ram export TMP=$TEMPDIR export TMPDIR=$TEMPDIR mkdir -p $TEMPDIR #--------------------------------------------------------------------- # "configure" step. GCCLANG="c,c++,fortran,objc,obj-c++" export LACNOWERROR=no PATH=`pwd`:$PATH bash ../gcc*/configure \ --prefix=$PREFIX \ --build=$LACARCHBUILD \ --host=$LACARCHHOST \ \ --disable-bootstrap \ --disable-libmpx \ --disable-libstdcxx-pch \ --disable-multilib \ --disable-nls \ \ --enable-c99 \ --enable-checking=release \ --enable-clocale=gnu \ --enable-languages=$GCCLANG \ --enable-libgomp \ --enable-lto=yes \ --enable-shared \ --enable-static \ --enable-threads=posix \ --enable-__cxa_atexit \ \ --libexecdir=$PREFIX/lib #--------------------------------------------------------------------- # Not used under normal circumstances: # # --with-gmp=$PREFIX \ # --with-mpc=$PREFIX \ # --with-mpfr=$PREFIX \ # --with-local-prefix=$PREFIX \ # --with-build-sysroot=$PREFIX \ # --with-sysroot=$PREFIX \ #--------------------------------------------------------------------- LACLIBTOOL=`which libtool` for x in $SDIR $XDIR do cd $x for ltfile in `find . -type f -name libtool` do # These commands may be needed for cross-compilation: # rm $ltfile # cp -p $LACLIBTOOL $ltfile X=42 # Just a placeholder command done done #--------------------------------------------------------------------- GLIBCDIR=$LACSYSTREE/toolchain/lib ALIBCDIR=$PRODTREE/glibc/lib if [ -f "$ALIBCDIR/crti.o" ]; then GLIBCDIR=$ALIBCDIR fi if [ \! -f "$GLIBCDIR/crti.o" ]; then echo "Error: glibc crtX.o setup isn't as expected" exit 1 fi pushd $GLIBCDIR for x in /lib /usr/lib /usr/local/lib $LACSYSTREE/lib do mkdir -p $x for crto in *crt*.o do ln -nsf $GLIBCDIR/$crto $x/ done done popd #--------------------------------------------------------------------- cd / sync #--------------------------------------------------------------------- date && echo 1st make start cd $XDIR smpmake all-target-libgomp || make all-target-libgomp smpmake || smpmake || make date && echo 1st make done #--------------------------------------------------------------------- # "make install" step. date && echo make install start make install || make install || make install date && echo make install done for x in /lib /usr/lib /usr/local/lib $LACSYSTREE/lib do rm -f $x/crt*.o done #--------------------------------------------------------------------- date && echo Post-install cleanup install -v -dm755 $LACSYSTREE/lib/bfd-plugins ln -sfv \ ../../libexec/gcc/$(gcc -dumpmachine)/$GCCTRIPLE/liblto_plugin.so \ $LACSYSTREE/lib/bfd-plugins/ #--------------------------------------------------------------------- cd $BINDIR (strip -p * || true) 2> /dev/null rm -fr cc wrapcc sed -e "s@__META_SYSTREE__@$LACSYSTREE@g" \ -e "s@__META_PKGNAME__@$EXEWORD@g" \ < $PKGDIR_SPECIAL/altcc \ > cc chmod 755 cc sed -e "s@__META_LACARCH__@$LACARCH@g" \ < /laclin/sysutil/toolchain/wrapcc.txt \ > wrapcc chmod 755 wrapcc #--------------------------------------------------------------------- # The "for"-loop below tries to do the following: # # (1) rename 'C' compiler ELF executables that are not already named # "*.bin" to corresponding "*.bin" names # # (2) hard-link the original 'C' compiler executable names to a wrap- # per script that was installed previously # "trueifexe" is a distro-specific utility script. echo trueifexe loop start for x in c++ g++ gcc *-c++ *-g++ *-gcc *-gcc-[0-9.]* do if [ -f "$x.bin" ]; then trueifexe "$x.bin" || (echo trueifexe error-1: $x ; exit 1) fi z=`echo $x | sed 's/\.bin//'` if [ "@$x" == "@$z" ]; then # Doesn't end with ".bin" trueifexe $x && rm -fr $x.bin && mv $x $x.bin ln -f wrapcc $x trueifexe "$x.bin" || (echo trueifexe error-2: $x ; exit 1) else trueifexe "$x" || (echo trueifexe error-3: $x ; exit 1) fi done echo trueifexe loop end #--------------------------------------------------------------------- rm -f $LIBDIR/libstdc++.so.*-gdb.py #--------------------------------------------------------------------- # This is needed by some programs. It may need some work. cd $PREFIX sed -e 's|#include_next|#include|' \ -i `find . -type f -name cstdlib` \ `find . -type f -name cmath` \ `find . -type f -name std_abs.h` rm -fr `find . -type d -name include-fixed` #--------------------------------------------------------------------- # Wrap it up. date && echo Done #--------------------------------------------------------------------- # Original URLs. These URLs were valid at one point, but may have died # since then. If you download newer versions of tarballs [etc.], don't # delete the original versions, as you may not be able to replace # them. [urls] url_debian = tbd url_home = http://www.gnu.org/software/gcc/ url_tarball = ftp://ftp.gnu.org/gnu/gcc/gcc-9.2.0/gcc-9.2.0.tar.xz url_lfs = http://www.linuxfromscratch.org/lfs/view/\ stable/chapter06/gcc.html #--------------------------------------------------------------------- [history] 190825 Added package. Started with 9.2.0.