# gcc731/cfg - "Build" settings for package #--------------------------------------------------------------------- [technotes] 1. "gcc731" provides an old release of "gcc" (7.3.1). To use this release in a package, specify "compiler = gcc731" in the package's "cfg" file. To use this release to compile a 'C' program outside of the package context, try doing this to set up: PATH=$PRODTREE/gcc731/bin:$PATH #--------------------------------------------------------------------- 2. Presently, "gcc731" (gcc 7.3.1) 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" 7.3.1 to bootstrap this distro's copy. The details are beyond the scope of notes at this le- vel. #--------------------------------------------------------------------- 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. #--------------------------------------------------------------------- 5. The source tarball used by this package was created based on "svn" upstream sources. A procedure similar to the one shown in the "svn- fetch" block was used. #--------------------------------------------------------------------- [svnfetch] # Warning! This script will delete all existing directories and/or # files in the current directory with names of the form NAME or # NAME-svn* where NAME is the project name specified below (by the # OUTBASE setting). #!/bin/bash -e OUTBASE=gcc DIR=$OUTBASE-svn URL=svn://gcc.gnu.org/svn/gcc/branches/gcc-7-branch rm -fr $OUTBASE $DIR* svn co $URL $DIR cd $DIR svn log | head -100000 > subversion-recent.log svnversion . > svnversion.txt rm -fr .svn cd .. NUMBER=`cat $DIR/svnversion.txt` BASE=$DIR-$NUMBER mv $DIR $BASE tar cf - $BASE | pbzip2 -c > $BASE.tar.bz2 #--------------------------------------------------------------------- [buildtimes] 00.21 hours (or 012.78 minutes) - HP EliteBook 8560w 32GB RAM 00.25 hours (or 015.27 minutes) - 2023 dedi Xeon E3-1200 v3 4x2 32GB RAM 00.28 hours (or 017.05 minutes) - ThinkPad E540 i7 4x2 16GB RAM 00.32 hours (or 019.10 minutes) - ThinkPad W530 i7 4x2 32GB RAM 00.58 hours (or 035.05 minutes) - ThinkPad W530 i7 4x2 32GB RAM using a 64-bit kernel and 32-bit distro #--------------------------------------------------------------------- [settings] altpkg = yes 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 = 715M unpack = relaxed #--------------------------------------------------------------------- [depends] actools:forward bison:forward chrpath:forward flex:forward gawk:forward grep:forward none #--------------------------------------------------------------------- [build] #--------------------------------------------------------------------- # Initial setup. GCCTRIPLE=7.3.1 PATH=$PRODTREE/gcc731/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-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 = svn # See "technotes" in "cfg" file url_lfs = http://www.linuxfromscratch.org/lfs/view/\ stable/chapter06/gcc.html #--------------------------------------------------------------------- [history] 170430 Updated from 20160214 to 20170426 170521 Updated from 20170426 to 20170510 170704 Updated from 20170510 to 6.4.0 171022 Updated from 6.4.0 to 253993 ("svn" revision, gcc6 branch) 171102 Updated from 254135 to 254360 171114 Updated from 254360 to 254742 171204 Updated from 254742 to 255377 180114 Updated from 255377 to 256677 180303 Updated from 256677 to 258222 180316 Updated from 258222 to 258611 180407 Updated from 258611 to 259211 180524 Updated from 259211 to 260690 180623 Updated from 260690 to 261983 180624 Updated from 261983 to 7.3.0 180630 Updated from 7.3.0 to 262282 ("svn" revision, gcc7 branch) 180720 Updated from 262282 to 262899 180811 Updated from 262899 to 263488 180815 Updated from 263488 to 263572 181027 Updated from 263572 to 265568