Compiled on X8DTU with 2 physical Intel Xeon E5530 CPU (8C16T) Compile Flags: unset CFLAGS CXXFLAGS LDFLAGS Dependencies: (some of them are not required, I'm just following 'compile_tc13_x86_64' to be safe) tce-load -i compiletc perl5 ncursesw-dev bash mpc-dev udev-lib-dev texinfo coreutils glibc_apps rsync gettext python3.6 git Commands: tce-load -i tar pixz time tar -I pixz -xf gcc-11.2.0.tar.xz real 0m 11.78s user 0m 11.48s sys 0m 6.13s cd gcc-11.2.0/ sed -e '/static.*SIGSTKSZ/d' -e 's/return kAltStackSize/return SIGSTKSZ * 4/' -i.orig libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64 ### edit gcc/config/i386/linux64.h ### #define GLIBC_DYNAMIC_LINKER64 "/lib/ld-linux-x86-64.so.2" ### edit with sed sed -e '/GLIBC_DYNAMIC_LINKER64/ s:/lib64/:/lib/:' -i.orig gcc/config/i386/linux64.h mkdir build && cd build CC="gcc -mtune=generic -Os -pipe" CXX="g++ -mtune=generic -Os -pipe" ../configure --prefix=/usr/local --enable-languages=c,c++,fortran --disable-multilib --disable-bootstrap --with-system-zlib --libexecdir=/usr/local/lib find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \; find . -name Makefile -type f -exec sed -i 's/-O2 -g//g' {} \; find . -name config.status -type f -exec sed -i 's/-g -O2//g' {} \; time make -j16 real 8m 27.73s user 1h 21m 15s sys 4m 37.77s DESTDIR=/tmp/packing time make install real 0m 15.56s user 0m 11.28s sys 0m 4.05s # Don't strip debug info for gfortran static objects, someone might need it cd /tmp mkdir -p packing-lib/usr/local/lib # shared objects first mv /tmp/packing/usr/local/lib/libgfortran.so* packing-lib/usr/local/lib strip --strip-unneeded packing-lib/usr/local/lib/libgfortran.so.5.0.0 # main extension mkdir -p packing-main/usr/local/lib/gcc/x86_64-pc-linux-gnu/11.2.0/ # f951 mv packing/usr/local/lib/gcc/x86_64-pc-linux-gnu/11.2.0/f951 packing-main/usr/local/lib/gcc/x86_64-pc-linux-gnu/11.2.0/ # finclude/ mv packing/usr/local/lib/gcc/x86_64-pc-linux-gnu/11.2.0/finclude/ packing-main/usr/local/lib/gcc/x86_64-pc-linux-gnu/11.2.0/ # libcaf_single.a, libcaf_single.la mv packing/usr/local/lib/gcc/x86_64-pc-linux-gnu/11.2.0/libcaf_single.* packing-main/usr/local/lib/gcc/x86_64-pc-linux-gnu/11.2.0/ # libgfortran.a, libgfortran.la, libgfortran.spec mv packing/usr/local/lib/libgfortran.* packing-main/usr/local/lib/ # binaries mkdir packing-main/usr/local/bin mv packing/usr/local/bin/*gfortran packing-main/usr/local/bin strip --strip-unneeded packing-main/usr/local/bin/* packing-main/usr/local/lib/gcc/x86_64-pc-linux-gnu/11.2.0/f951 # liblto_plugin (75K --> 76K) # in gcc 10.2, the plugin is named liblto_plugin.so.0.0.0 # in gcc 11.2, the plugin is named liblto_plugin.so mv packing/usr/local/lib/gcc/x86_64-pc-linux-gnu/11.2.0/liblto_plugin.so packing-main/usr/local/lib/gcc/x86_64-pc-linux-gnu/11.2.0/GFORTRAN-liblto_plugin.so strip --strip-unneeded packing-main/usr/local/lib/gcc/x86_64-pc-linux-gnu/11.2.0/GFORTRAN-liblto_plugin.so # tce.installed #!/bin/sh # LTO plugin LTO_PLUGIN='/usr/local/lib/gcc/x86_64-pc-linux-gnu/11.2.0/GFORTRAN-liblto_plugin.so' CURRENT='/usr/local/lib/bfd-plugins/liblto_plugin.so' /bin/busybox mkdir -p /usr/local/lib/bfd-plugins /bin/busybox cp $LTO_PLUGIN $CURRENT # binaries for BIN in /usr/local/bin/gfortran /usr/local/bin/x86_64-pc-linux-gnu-gfortran /usr/local/lib/gcc/x86_64-pc-linux-gnu/11.2.0/f951 do [ -L $BIN ] && /bin/busybox cp $(/bin/busybox realpath $BIN) $BIN done # distcc if [ -f /usr/local/tce.installed/distcc ]; then cd /usr/lib/distcc && \ ln -sf ../../local/bin/distcc gfortran && \ ln -sf ../../local/bin/distcc x86_64-pc-linux-gnu-gfortran cd /usr/local/lib/distcc && \ ln -sf ../../bin/distcc gfortran && \ ln -sf ../../bin/distcc x86_64-pc-linux-gnu-gfortran fi