summaryrefslogtreecommitdiffstats
path: root/testing/source/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'testing/source/gcc')
-rw-r--r--testing/source/gcc/c89.sh10
-rw-r--r--testing/source/gcc/c99.sh10
-rwxr-xr-xtesting/source/gcc/gcc.SlackBuild624
-rw-r--r--testing/source/gcc/patches/gcc-no_fixincludes.diff31
-rw-r--r--testing/source/gcc/slack-desc.gcc19
-rw-r--r--testing/source/gcc/slack-desc.gcc-g++19
-rw-r--r--testing/source/gcc/slack-desc.gcc-gdc19
-rw-r--r--testing/source/gcc/slack-desc.gcc-gfortran19
-rw-r--r--testing/source/gcc/slack-desc.gcc-gnat19
-rw-r--r--testing/source/gcc/slack-desc.gcc-go19
-rw-r--r--testing/source/gcc/slack-desc.gcc-objc19
11 files changed, 808 insertions, 0 deletions
diff --git a/testing/source/gcc/c89.sh b/testing/source/gcc/c89.sh
new file mode 100644
index 000000000..35486ea83
--- /dev/null
+++ b/testing/source/gcc/c89.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+fl="-std=c89"
+for opt; do
+ case "$opt" in
+ -ansi|-std=c89|-std=iso9899:1990) fl="";;
+ -std=*) echo "`basename $0` called with non ANSI/ISO C option $opt" >&2
+ exit 1;;
+ esac
+done
+exec gcc $fl ${1+"$@"}
diff --git a/testing/source/gcc/c99.sh b/testing/source/gcc/c99.sh
new file mode 100644
index 000000000..88dd80640
--- /dev/null
+++ b/testing/source/gcc/c99.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+fl="-std=c99"
+for opt; do
+ case "$opt" in
+ -std=c99|-std=iso9899:1999) fl="";;
+ -std=*) echo "`basename $0` called with non ISO C99 option $opt" >&2
+ exit 1;;
+ esac
+done
+exec gcc $fl ${1+"$@"}
diff --git a/testing/source/gcc/gcc.SlackBuild b/testing/source/gcc/gcc.SlackBuild
new file mode 100755
index 000000000..820671576
--- /dev/null
+++ b/testing/source/gcc/gcc.SlackBuild
@@ -0,0 +1,624 @@
+#!/bin/bash
+# GCC package build script (written by volkerdi@slackware.com)
+#
+# Copyright 2003, 2004 Slackware Linux, Inc., Concord, California, USA
+# Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021, 2022, 2023 Patrick J. Volkerding, Sebeka, MN, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+# Modified 2011 by Eric Hameleers <alien at slackware.com> for OpenJDK.
+
+# Some notes, Fri May 16 12:31:32 PDT 2003:
+#
+# Why i486 and not i386? Because the shared C++ libraries in gcc-3.2.x will
+# require 486 opcodes even when a 386 target is used (so we already weren't
+# compatible with the i386 for Slackware 9.0, didn't notice, and nobody
+# complained :-). gcc-3.3 fixes this issue and allows you to build a 386
+# compiler, but the fix is done in a way that produces binaries that are not
+# compatible with gcc-3.2.x compiled binaries. To retain compatibility with
+# Slackware 9.0, we'll have to use i486 (or better) as the compiler target
+# for gcc-3.3.
+#
+# It's time to say goodbye to i386 support in Slackware. I've surveyed 386
+# usage online, and the most common thing I see people say when someone asks
+# about running Linux on a 386 is to "run Slackware", but then they also
+# usually go on to say "be sure to get an OLD version, like 4.0, before glibc,
+# because it'll be more efficient." Now, if that's the general advice, then
+# I see no reason to continue 386 support in the latest Slackware (and indeed
+# it's no longer easily possible).
+
+# Some more notes, Mon Aug 3 19:49:51 UTC 2015:
+#
+# Changing to -march=i586 for 32-bit x86 as several things (Mesa being one of
+# them) no longer work if constrained to -march=i486. We're not going to use
+# -march=i686 since the only additional opcode is CMOV, which is actually less
+# efficient on modern CPUs running in 32-bit mode than the alternate i586
+# instructions. No need to throw i586 CPUs under the bus (yet).
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PKGNAM=gcc
+SRCVER=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+VERSION=$(echo $SRCVER | cut -f 1 -d _)
+BUILD=${BUILD:-1}
+
+# How many jobs to run in parallel:
+NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$(uname -m)" in
+ i?86) ARCH=i586 ;;
+ arm*) readelf /usr/bin/file -A | grep -E -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7hl ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) ARCH=$(uname -m) ;;
+ esac
+ export ARCH
+fi
+
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "gcc-$VERSION-$ARCH-$BUILD.txz"
+ echo "gcc-g++-$VERSION-$ARCH-$BUILD.txz"
+ echo "gcc-gfortran-$VERSION-$ARCH-$BUILD.txz"
+ echo "gcc-gnat-$VERSION-$ARCH-$BUILD.txz"
+ echo "gcc-objc-$VERSION-$ARCH-$BUILD.txz"
+ echo "gcc-go-$VERSION-$ARCH-$BUILD.txz"
+ echo "gcc-gdc-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
+if [ "$ARCH" = "i386" ]; then
+ SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
+ LIBDIRSUFFIX=""
+ LIB_ARCH=i386
+elif [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+ LIB_ARCH=i386
+elif [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+ LIB_ARCH=i386
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686"
+ LIBDIRSUFFIX=""
+ LIB_ARCH=i386
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+ LIB_ARCH=s390
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+ LIB_ARCH=amd64
+elif [ "$ARCH" = "armv7hl" ]; then
+ SLKCFLAGS="-O3 -march=armv7-a -mfpu=vfpv3-d16"
+ LIBDIRSUFFIX=""
+ LIB_ARCH=armv7hl
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+ LIB_ARCH=$ARCH
+fi
+
+case "$ARCH" in
+ arm*) TARGET=$ARCH-slackware-linux-gnueabi ;;
+ *) TARGET=$ARCH-slackware-linux ;;
+esac
+
+# Temporary build location:
+TMP=${TMP:-/tmp}
+
+# Extract the source code:
+cd $TMP
+rm -rf gcc-$SRCVER
+tar xvf $CWD/gcc-$SRCVER.tar.?z || exit 1
+
+# This is the main DESTDIR target:
+PKG1=$TMP/package-gcc
+# These are the directories to build other packages in:
+PKG2=$TMP/package-gcc-g++
+PKG3=$TMP/package-gcc-gfortran
+PKG4=$TMP/package-gcc-gnat
+PKG6=$TMP/package-gcc-objc
+PKG8=$TMP/package-gcc-go
+PKG10=$TMP/package-gcc-gdc
+
+# Clear the build locations:
+rm -rf $PKG{1,2,3,4,6,8,10}
+mkdir -p $PKG{1,2,3,4,6,8,10}/usr/doc/gcc-$VERSION
+
+# Insert package descriptions:
+mkdir -p $PKG{1,2,3,4,6,8,9,10}/install
+cat $CWD/slack-desc.gcc > $PKG1/install/slack-desc
+cat $CWD/slack-desc.gcc-g++ > $PKG2/install/slack-desc
+cat $CWD/slack-desc.gcc-gfortran > $PKG3/install/slack-desc
+cat $CWD/slack-desc.gcc-gnat > $PKG4/install/slack-desc
+cat $CWD/slack-desc.gcc-objc > $PKG6/install/slack-desc
+cat $CWD/slack-desc.gcc-go > $PKG8/install/slack-desc
+cat $CWD/slack-desc.gcc-gdc > $PKG10/install/slack-desc
+
+cd gcc-$SRCVER || exit 1
+
+# Smite the fixincludes:
+zcat $CWD/patches/gcc-no_fixincludes.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1
+
+# Fix perms/owners:
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 754 \) \
+ -exec chmod 755 {} \+ -o \
+ \( -perm 664 \) \
+ -exec chmod 644 {} \+
+
+# Install docs:
+mkdir -p $PKG1/usr/doc/gcc-$VERSION
+cp -a \
+ COPYING* ChangeLog* FAQ INSTALL \
+ LAST_UPDATED MAINTAINERS NEWS \
+ README* *.html \
+$PKG1/usr/doc/gcc-$VERSION
+
+# We will keep part of these, but they are really big...
+if [ -r ChangeLog ]; then
+ DOCSDIR=$(echo $PKG1/usr/doc/gcc-$VERSION)
+ cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
+ touch -r ChangeLog $DOCSDIR/ChangeLog
+fi
+if [ -r NEWS ]; then
+ DOCSDIR=$(echo $PKG1/usr/doc/gcc-$VERSION)
+ cat NEWS | head -n 1500 > $DOCSDIR/NEWS
+ touch -r NEWS $DOCSDIR/NEWS
+fi
+
+mkdir -p $PKG1/usr/doc/gcc-${VERSION}/gcc
+( cd gcc || exit 0
+ cp -a \
+ ABOUT* COPYING* DATESTAMP DEV-PHASE LANG* ONEWS README* SERVICE \
+ $PKG1/usr/doc/gcc-$VERSION/gcc
+)
+
+mkdir -p $PKG3/usr/doc/gcc-${VERSION}/gcc/fortran
+( cd gcc/fortran || exit 0
+ if [ -r ChangeLog ]; then
+ cat ChangeLog | head -n 1000 > $PKG3/usr/doc/gcc-$VERSION/gcc/fortran/ChangeLog
+ touch -r ChangeLog $PKG3/usr/doc/gcc-$VERSION/gcc/fortran/ChangeLog
+ fi
+)
+
+mkdir -p $PKG4/usr/doc/gcc-${VERSION}/gcc/ada
+( cd gcc/ada || exit 0
+ cp -a \
+ ChangeLog.tree-ssa \
+ $PKG4/usr/doc/gcc-$VERSION/gcc/ada
+ if [ -r ChangeLog ]; then
+ cat ChangeLog | head -n 1000 > $PKG4/usr/doc/gcc-$VERSION/gcc/ada/ChangeLog
+ touch -r ChangeLog $PKG4/usr/doc/gcc-$VERSION/gcc/ada/ChangeLog
+ fi
+)
+
+mkdir -p $PKG6/usr/doc/gcc-${VERSION}/gcc/objc
+( cd gcc/objc || exit 0
+ cp -a \
+ README* \
+ $PKG6/usr/doc/gcc-${VERSION}/gcc/objc
+ if [ -r ChangeLog ]; then
+ cat ChangeLog | head -n 1000 > $PKG6/usr/doc/gcc-${VERSION}/gcc/objc/ChangeLog
+ touch -r ChangeLog $PKG6/usr/doc/gcc-${VERSION}/gcc/objc/ChangeLog
+ fi
+)
+
+mkdir -p $PKG6/usr/doc/gcc-${VERSION}/gcc/objcp
+( cd gcc/objcp || exit 0
+ cp -a \
+ README* \
+ $PKG6/usr/doc/gcc-${VERSION}/gcc/objcp
+ if [ -r ChangeLog ]; then
+ cat ChangeLog | head -n 1000 > $PKG6/usr/doc/gcc-${VERSION}/gcc/objcp/ChangeLog
+ touch -r ChangeLog $PKG6/usr/doc/gcc-${VERSION}/gcc/objcp/ChangeLog
+ fi
+)
+
+mkdir -p $PKG8/usr/doc/gcc-${VERSION}/gcc/go
+( cd gcc/go || exit 0
+ if [ -r ChangeLog ]; then
+ cat ChangeLog | head -n 1000 > $PKG8/usr/doc/gcc-${VERSION}/gcc/go/ChangeLog
+ touch -r ChangeLog $PKG8/usr/doc/gcc-${VERSION}/gcc/go/ChangeLog
+ fi
+ cp -a \
+ README* THREADS* \
+ gofrontend/{LICENSE,PATENTS,README} \
+ $PKG8/usr/doc/gcc-${VERSION}/gcc/go
+)
+
+mkdir -p $PKG10/usr/doc/gcc-${VERSION}/gcc/d
+( cd gcc/d || exit 0
+ if [ -r ChangeLog ]; then
+ cat ChangeLog | head -n 1000 > $PKG10/usr/doc/gcc-${VERSION}/gcc/d/ChangeLog
+ touch -r ChangeLog $PKG10/usr/doc/gcc-${VERSION}/gcc/d/ChangeLog
+ fi
+)
+
+mkdir -p $PKG3/usr/doc/gcc-${VERSION}/libgfortran
+( cd libgfortran || exit 0
+ if [ -r ChangeLog ]; then
+ cat ChangeLog | head -n 1000 > $PKG3/usr/doc/gcc-${VERSION}/libgfortran/ChangeLog
+ touch -r ChangeLog $PKG3/usr/doc/gcc-${VERSION}/libgfortran/ChangeLog
+ fi
+)
+
+mkdir -p $PKG4/usr/doc/gcc-${VERSION}/libada
+( cd libada || exit 0
+ if [ -r ChangeLog ]; then
+ cat ChangeLog | head -n 1000 > $PKG4/usr/doc/gcc-${VERSION}/libada/ChangeLog
+ touch -r ChangeLog $PKG4/usr/doc/gcc-${VERSION}/libada/ChangeLog
+ fi
+)
+
+mkdir -p $PKG1/usr/doc/gcc-${VERSION}/libgomp
+( cd libgomp || exit 0
+ if [ -r ChangeLog ]; then
+ cat ChangeLog | head -n 1000 > $PKG1/usr/doc/gcc-${VERSION}/libgomp/ChangeLog
+ touch -r ChangeLog $PKG1/usr/doc/gcc-${VERSION}/libgomp/ChangeLog
+ fi
+)
+
+mkdir -p $PKG6/usr/doc/gcc-${VERSION}/libobjc
+( cd libobjc || exit 0
+ if [ -r ChangeLog ]; then
+ cat ChangeLog | head -n 1000 > $PKG6/usr/doc/gcc-${VERSION}/libobjc/ChangeLog
+ touch -r ChangeLog $PKG6/usr/doc/gcc-${VERSION}/libobjc/ChangeLog
+ fi
+ cp -a \
+ README* THREADS* \
+ $PKG6/usr/doc/gcc-${VERSION}/libobjc
+)
+
+mkdir -p $PKG2/usr/doc/gcc-${VERSION}/libstdc++-v3
+( cd libstdc++-v3 || exit 0
+ cp -a \
+ README* \
+ doc/html/faq.html \
+ $PKG2/usr/doc/gcc-${VERSION}/libstdc++-v3
+ if [ -r ChangeLog ]; then
+ cat ChangeLog | head -n 1000 > $PKG2/usr/doc/gcc-${VERSION}/libstdc++-v3/ChangeLog
+ touch -r ChangeLog $PKG2/usr/doc/gcc-${VERSION}/libstdc++-v3/ChangeLog
+ fi
+)
+
+# build gcc
+( mkdir gcc.build.lnx
+ cd gcc.build.lnx
+
+ # I think it's incorrect to include this option (as it'll end up set
+ # to i586 on x86 platforms), and we want to tune the binary structure
+ # for i686, as that's where almost all of the optimization speedups
+ # are to be found.
+ # Correct me if my take on this is wrong.
+ # --with-cpu=$ARCH
+
+ if [ "$ARCH" != "x86_64" ]; then
+ GCC_ARCHOPTS="--with-arch=$ARCH"
+ else
+ GCC_ARCHOPTS="--disable-multilib"
+ fi
+
+ CFLAGS="$SLKCFLAGS" \
+ CXXFLAGS="$SLKCFLAGS" \
+ ../configure --prefix=/usr \
+ --libdir=/usr/lib$LIBDIRSUFFIX \
+ --mandir=/usr/man \
+ --infodir=/usr/info \
+ --enable-shared \
+ --enable-bootstrap \
+ --enable-languages=ada,c,c++,d,fortran,go,lto,objc,obj-c++ \
+ --enable-threads=posix \
+ --enable-checking=release \
+ --enable-objc-gc \
+ --with-system-zlib \
+ --enable-libstdcxx-dual-abi \
+ --with-default-libstdcxx-abi=new \
+ --disable-libstdcxx-pch \
+ --disable-libunwind-exceptions \
+ --enable-__cxa_atexit \
+ --disable-libssp \
+ --enable-gnu-unique-object \
+ --enable-plugin \
+ --enable-lto \
+ --disable-install-libiberty \
+ --disable-werror \
+ --with-gnu-ld \
+ --with-isl \
+ --verbose \
+ --with-arch-directory=$LIB_ARCH \
+ --disable-gtktest \
+ --enable-clocale=gnu \
+ $GCC_ARCHOPTS \
+ --target=${TARGET} \
+ --build=${TARGET} \
+ --host=${TARGET} || exit 1
+
+ # Start the build:
+
+ # Include all debugging info (for now):
+ make $NUMJOBS bootstrap || exit 1
+
+ ( cd gcc
+ make $NUMJOBS gnatlib GNATLIBCFLAGS="$SLKCFLAGS" || exit 1
+ # This wants a shared -ladd2line?
+ #make gnatlib-shared || exit 1
+
+ CFLAGS="$SLKCFLAGS" \
+ CXXFLAGS="$SLKCFLAGS" \
+ make $NUMJOBS gnattools || exit 1
+ ) || exit 1
+ make info || exit 1
+
+ # Set GCCCHECK=something to run the tests
+ if [ ! -z $GCCCHECK ]; then
+ make $NUMJOBS check || exit 1
+ fi
+
+ make install DESTDIR=$PKG1 || exit 1
+
+ # Move gdb pretty printers to the correct place
+ mkdir -p $PKG1/usr/share/gdb/auto-load/usr/lib$LIBDIRSUFFIX
+ mv $PKG1/usr/lib$LIBDIRSUFFIX/*-gdb.py \
+ $PKG1/usr/share/gdb/auto-load/usr/lib$LIBDIRSUFFIX/
+
+ # Be sure the "specs" file is installed.
+ if [ ! -r $PKG1/usr/lib${LIBDIRSUFFIX}/gcc/${TARGET}/${VERSION}/specs ]; then
+ cat stage1-gcc/specs > $PKG1/usr/lib${LIBDIRSUFFIX}/gcc/${TARGET}/${VERSION}/specs
+ fi
+
+ # Make our 64bit gcc look for 32bit gcc binaries in ./32 subdirectory:
+ if [ "$ARCH" = "x86_64" ]; then
+ sed -i 's#;.\(:../lib !m64 m32;\)$#;32\1#' \
+ $PKG1/usr/lib${LIBDIRSUFFIX}/gcc/${TARGET}/${VERSION}/specs
+ fi
+
+ # make ada.install-common DESTDIR=$PKG1 || exit 1
+ # make install-gnatlib DESTDIR=$PKG1 || exit 1
+ make -i install-info DESTDIR=$PKG1 || exit 1
+
+ chmod 755 $PKG1/usr/lib${LIBDIRSUFFIX}/libgcc_s.so.1
+
+ # Fix stuff up:
+ ( cd $PKG1/usr/info ; rm dir ; gzip -9 * )
+ ( cd $PKG1
+ # *not* ${LIBDIRSUFFIX}
+ mkdir -p lib
+ cd lib
+ ln -sf /usr/bin/cpp .
+ )
+
+ ( cd $PKG1/usr/bin
+ mv g++ g++-gcc-$VERSION
+ mv gcc gcc-$VERSION
+ mv ${TARGET}-gfortran gfortran-gcc-$VERSION
+ ln -sf g++-gcc-$VERSION g++
+ ln -sf gcc-$VERSION gcc
+ ln -sf g++ c++
+ ln -sf gcc cc
+ ln -sf gcc-$VERSION ${TARGET}-cc
+ ln -sf gcc-$VERSION ${TARGET}-gcc
+ ln -sf gcc-$VERSION ${TARGET}-gcc-$VERSION
+ ln -sf gcc-ar ${TARGET}-gcc-ar
+ ln -sf gcc-nm ${TARGET}-gcc-nm
+ ln -sf gcc-ranlib ${TARGET}-gcc-ranlib
+ ln -sf g++-gcc-$VERSION ${TARGET}-c++
+ ln -sf g++-gcc-$VERSION ${TARGET}-g++
+ ln -sf gfortran-gcc-$VERSION gfortran
+ ln -sf gfortran-gcc-$VERSION ${TARGET}-gfortran
+ ln -sf gfortran-gcc-$VERSION ${TARGET}-gfortran-$VERSION
+ ln -sf gfortran-gcc-$VERSION ${TARGET}-g95
+ ln -sf gfortran g95
+ ln -sf gfortran f95
+ ln -sf gfortran-gcc-$VERSION ${TARGET}-g77
+ ln -sf gfortran g77
+ ln -sf gfortran f77
+ cat $CWD/c89.sh > c89
+ cat $CWD/c99.sh > c99
+ chmod 755 c89 c99
+ )
+
+ ( cd $PKG1/usr/man
+ gzip -9 */*
+ cd man1
+ ln -sf g++.1.gz c++.1.gz
+ ln -sf gcc.1.gz cc.1.gz
+ )
+
+ ## build an all-in-one txz package:
+ #(
+ # cd $PKG1;
+ # makepkg -l y -c n $TMP/gcc-$VERSION-$ARCH-$BUILD.txz
+ #)
+
+# keep a log:
+) 2>&1 | tee gcc.build.log
+
+# Filter all .la files (thanks much to Mark Post for the sed script):
+( cd $PKG1
+ for file in $(find . -type f -name "*.la") ; do
+ cat $file | sed -e 's%-L/gcc-[[:graph:]]* % %g' > $TMP/tmp-la-file
+ cat $TMP/tmp-la-file > $file
+ done
+ rm $TMP/tmp-la-file
+)
+
+# Don't ship .la files in /{,usr/}lib${LIBDIRSUFFIX}:
+rm -f $PKG1/{,usr/}lib${LIBDIRSUFFIX}/*.la
+
+# Strip bloated binaries and libraries:
+( cd $PKG1
+ find . -name "lib*so*" -exec strip --strip-unneeded "{}" \;
+ find . -name "lib*so*" -exec patchelf --remove-rpath "{}" \;
+ find . -name "lib*a" -exec strip -g "{}" \;
+ strip --strip-unneeded usr/bin/* 2> /dev/null
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+ find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+)
+
+# OK, time to split the big package where needed:
+
+# gcc-g++:
+( cd $PKG2
+ mkdir -p usr/bin
+ mv $PKG1/usr/bin/*++* usr/bin
+ mkdir -p usr/include
+ mv $PKG1/usr/include/c++ usr/include
+ mkdir -p usr/lib${LIBDIRSUFFIX}
+ mv $PKG1/usr/lib${LIBDIRSUFFIX}/*++* usr/lib${LIBDIRSUFFIX}
+ mkdir -p usr/libexec/gcc/$TARGET/$VERSION
+ mv $PKG1/usr/libexec/gcc/$TARGET/$VERSION/cc1plus usr/libexec/gcc/$TARGET/$VERSION/cc1plus
+ mkdir -p usr/man/man1
+ mv $PKG1/usr/man/man1/*++* usr/man/man1
+ mkdir -p usr/share
+ mv $PKG1/usr/share/gdb usr/share
+ mkdir -p usr/share/gcc-$VERSION/python
+ mv $PKG1/usr/share/gcc-$VERSION/python/libstdcxx usr/share/gcc-$VERSION/python
+)
+
+# gcc-gfortran:
+( cd $PKG3
+ mkdir -p usr/bin
+ mv $PKG1/usr/bin/*gfortran* usr/bin
+ mv $PKG1/usr/bin/*95* usr/bin
+ mv $PKG1/usr/bin/*77* usr/bin
+ # Doesn't this seem like a logical idea?
+ ( cd usr/bin ; ln -sf gfortran-gcc-${VERSION} fortran )
+ mkdir -p usr/info
+ mv $PKG1/usr/info/gfortran* usr/info
+ mkdir -p usr/lib${LIBDIRSUFFIX}
+ mv $PKG1/usr/lib${LIBDIRSUFFIX}/libgfortran* usr/lib${LIBDIRSUFFIX}
+ mkdir -p usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION
+ mv $PKG1/usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION/finclude usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION
+ mv $PKG1/usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION/libgfortran* usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION
+ mkdir -p usr/libexec/gcc/$TARGET/$VERSION
+ mv $PKG1/usr/libexec/gcc/$TARGET/$VERSION/f951 usr/libexec/gcc/$TARGET/$VERSION/f951
+ mv $PKG1/usr/libexec/gcc/$TARGET/$VERSION/libgfortran* usr/libexec/gcc/$TARGET/$VERSION
+ mkdir -p usr/man/man1
+ mv $PKG1/usr/man/man1/gfortran* usr/man/man1
+)
+
+# gcc-gnat:
+( cd $PKG4
+ mkdir -p usr/bin
+ mv $PKG1/usr/bin/gnat* usr/bin
+ mv $PKG1/usr/bin/gpr* usr/bin
+ mkdir -p usr/info
+ mv $PKG1/usr/info/gnat* usr/info
+ mkdir -p usr/libexec/gcc/$TARGET/$VERSION
+ mv $PKG1/usr/libexec/gcc/$TARGET/$VERSION/gnat1 usr/libexec/gcc/$TARGET/$VERSION
+ mkdir -p usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION
+ mv $PKG1/usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION/adainclude usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION
+ mv $PKG1/usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION/adalib usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION
+)
+
+# gcc-objc:
+( cd $PKG6
+ mkdir -p usr/lib${LIBDIRSUFFIX}
+ mv $PKG1/usr/lib${LIBDIRSUFFIX}/libobjc* usr/lib${LIBDIRSUFFIX}
+ mkdir -p usr/libexec/gcc/$TARGET/$VERSION
+ mv $PKG1/usr/libexec/gcc/$TARGET/$VERSION/cc1obj usr/libexec/gcc/$TARGET/$VERSION
+ mv $PKG1/usr/libexec/gcc/$TARGET/$VERSION/cc1objplus usr/libexec/gcc/$TARGET/$VERSION
+ mkdir -p usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION/include
+ mv $PKG1/usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION/include/objc usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION/include
+ mv $PKG1/usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION/include/cc1objplus usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION/include
+)
+
+## NOTE: Thought about this, because the precompiled headers are so large.
+## Probably easier to keep everything together, though.
+## gcc-g++-gch (precompiled c++ headers)
+#( cd $PKG7
+# mkdir -p usr/include/c++/$VERSION/$TARGET/bits
+# mv $PKG2/usr/include/c++/$VERSION/$TARGET/bits/stdc++.h.gch usr/include/c++/$VERSION/$TARGET/bits
+#)
+
+# gcc-go:
+( cd $PKG8
+ mkdir -p usr/bin
+ mv $PKG1/usr/bin/*gccgo* usr/bin
+ mv $PKG1/usr/bin/go{,fmt} usr/bin
+ mkdir -p usr/libexec/gcc/$TARGET/$VERSION
+ mv $PKG1/usr/libexec/gcc/$TARGET/$VERSION/{cgo,go1} usr/libexec/gcc/$TARGET/$VERSION
+ mkdir -p usr/info
+ mv $PKG1/usr/info/gccgo.info.gz usr/info
+ mkdir -p usr/lib${LIBDIRSUFFIX}
+ mv $PKG1/usr/lib${LIBDIRSUFFIX}/go usr/lib${LIBDIRSUFFIX}
+ if [ -r $PKG1/usr/lib${LIBDIRSUFFIX}/libgo.la ]; then
+ mv $PKG1/usr/lib${LIBDIRSUFFIX}/libgo.la usr/lib${LIBDIRSUFFIX}
+ fi
+ mv $PKG1/usr/lib${LIBDIRSUFFIX}/{libgo.so*,libgobegin.a,libgolibbegin.a} usr/lib${LIBDIRSUFFIX} || exit 1
+ # Don't package the (bloated) libgo.a. As a rule, we don't package static libraries.
+ rm -f $PKG1/usr/lib${LIBDIRSUFFIX}/libgo.a
+ mkdir -p usr/man/man1
+ mv $PKG1/usr/man/man1/gccgo.1.gz usr/man/man1
+ mv $PKG1/usr/man/man1/go.1.gz usr/man/man1
+ mv $PKG1/usr/man/man1/gofmt.1.gz usr/man/man1
+) || exit 1
+
+# gcc-gdc:
+( cd $PKG10
+ mkdir -p usr/bin
+ mv $PKG1/usr/bin/gdc $PKG1/usr/bin/*-gdc usr/bin
+ mkdir -p usr/lib${LIBDIRSUFFIX}
+ mv $PKG1/usr/lib${LIBDIRSUFFIX}/libgdruntime* usr/lib${LIBDIRSUFFIX}
+ mv $PKG1/usr/lib${LIBDIRSUFFIX}/libgphobos* usr/lib${LIBDIRSUFFIX}
+ ## COMMENTED OUT: defaults to static linking and that default does not
+ ## seem to be easlity changed...
+ ## Don't package the (bloated) libgphobos.a or libgdruntime.a.
+ ## As a rule, we don't package static libraries.
+ #rm -f usr/lib${LIBDIRSUFFIX}/libgphobos.a
+ #rm -f usr/lib${LIBDIRSUFFIX}/libgdruntime.a
+ mkdir -p usr/libexec/gcc/$TARGET/$VERSION
+ mv $PKG1/usr/libexec/gcc/$TARGET/$VERSION/d21 usr/libexec/gcc/$TARGET/$VERSION
+ mkdir -p usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION/include
+ mv $PKG1/usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION/include/d usr/lib${LIBDIRSUFFIX}/gcc/$TARGET/$VERSION/include
+ mkdir -p usr/info
+ mv $PKG1/usr/info/gdc.info.gz usr/info
+ mkdir -p usr/man/man1
+ mv $PKG1/usr/man/man1/gdc.1.gz usr/man/man1
+) || exit 1
+
+# Generate packages:
+( cd $PKG1
+ makepkg -l y -c n $TMP/gcc-$VERSION-$ARCH-$BUILD.txz )
+( cd $PKG2
+ makepkg -l y -c n $TMP/gcc-g++-$VERSION-$ARCH-$BUILD.txz )
+( cd $PKG3
+ makepkg -l y -c n $TMP/gcc-gfortran-$VERSION-$ARCH-$BUILD.txz )
+( cd $PKG4
+ makepkg -l y -c n $TMP/gcc-gnat-$VERSION-$ARCH-$BUILD.txz )
+( cd $PKG6
+ makepkg -l y -c n $TMP/gcc-objc-$VERSION-$ARCH-$BUILD.txz )
+( cd $PKG8
+ makepkg -l y -c n $TMP/gcc-go-$VERSION-$ARCH-$BUILD.txz )
+( cd $PKG10
+ makepkg -l y -c n $TMP/gcc-gdc-$VERSION-$ARCH-$BUILD.txz )
+
+echo
+echo "Slackware GCC package build complete!"
+echo
+
diff --git a/testing/source/gcc/patches/gcc-no_fixincludes.diff b/testing/source/gcc/patches/gcc-no_fixincludes.diff
new file mode 100644
index 000000000..8307fbfc9
--- /dev/null
+++ b/testing/source/gcc/patches/gcc-no_fixincludes.diff
@@ -0,0 +1,31 @@
+--- ./gcc/Makefile.in.orig 2023-04-26 12:25:33.525797045 -0500
++++ ./gcc/Makefile.in 2023-04-26 13:40:12.282459243 -0500
+@@ -3202,11 +3202,11 @@
+ cp $(srcdir)/gsyslimits.h $${include_dir}/syslimits.h; \
+ done
+ # Install the README
+- if [ x$(STMP_FIXINC) != x ]; then \
+- rm -f include-fixed/README; \
+- cp $(srcdir)/../fixincludes/README-fixinc include-fixed/README; \
+- chmod a+r include-fixed/README; \
+- fi;
++# if [ x$(STMP_FIXINC) != x ]; then \
++# rm -f include-fixed/README; \
++# cp $(srcdir)/../fixincludes/README-fixinc include-fixed/README; \
++# chmod a+r include-fixed/README; \
++# fi;
+ $(STAMP) $@
+
+ .PHONY: install-gcc-tooldir
+@@ -3287,10 +3287,7 @@
+ (TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \
+ SHELL='$(SHELL)'; MACRO_LIST=`${PWD_COMMAND}`/macro_list ; \
+ gcc_dir=`${PWD_COMMAND}` ; \
+- export TARGET_MACHINE srcdir SHELL MACRO_LIST && \
+- cd $(build_objdir)/fixincludes && \
+- $(SHELL) ./fixinc.sh "$${gcc_dir}/$${fix_dir}" \
+- $(BUILD_SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) ); \
++ export TARGET_MACHINE srcdir SHELL MACRO_LIST ); \
+ done; \
+ fi
+ $(STAMP) stmp-fixinc
diff --git a/testing/source/gcc/slack-desc.gcc b/testing/source/gcc/slack-desc.gcc
new file mode 100644
index 000000000..2ec1b2bca
--- /dev/null
+++ b/testing/source/gcc/slack-desc.gcc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|' on
+# the right side marks the last column you can put a character in. You must make
+# exactly 11 lines for the formatting to be correct. It's also customary to
+# leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+gcc: gcc (Base GCC package with C support)
+gcc:
+gcc: GCC is the GNU Compiler Collection.
+gcc:
+gcc: This package contains those parts of the compiler collection needed to
+gcc: compile C code. Other packages add Ada, C++, D, Fortran, Go,
+gcc: Objective-C, and BRIG support to the compiler core.
+gcc:
+gcc:
+gcc:
+gcc:
diff --git a/testing/source/gcc/slack-desc.gcc-g++ b/testing/source/gcc/slack-desc.gcc-g++
new file mode 100644
index 000000000..6beaf21b1
--- /dev/null
+++ b/testing/source/gcc/slack-desc.gcc-g++
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|' on
+# the right side marks the last column you can put a character in. You must make
+# exactly 11 lines for the formatting to be correct. It's also customary to
+# leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+gcc-g++: gcc-g++ (C++ for GCC)
+gcc-g++:
+gcc-g++: C++ support for the GNU Compiler Collection.
+gcc-g++:
+gcc-g++: This package contains those parts of the compiler collection needed to
+gcc-g++: compile C++ code.
+gcc-g++:
+gcc-g++:
+gcc-g++:
+gcc-g++:
+gcc-g++:
diff --git a/testing/source/gcc/slack-desc.gcc-gdc b/testing/source/gcc/slack-desc.gcc-gdc
new file mode 100644
index 000000000..6b809ca1d
--- /dev/null
+++ b/testing/source/gcc/slack-desc.gcc-gdc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|' on
+# the right side marks the last column you can put a character in. You must make
+# exactly 11 lines for the formatting to be correct. It's also customary to
+# leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+gcc-gdc: gcc-gdc (D support for GCC)
+gcc-gdc:
+gcc-gdc: D support for the GNU Compiler Collection.
+gcc-gdc:
+gcc-gdc: D is a general-purpose programming language with static typing,
+gcc-gdc: systems-level access, and C-like syntax.
+gcc-gdc:
+gcc-gdc:
+gcc-gdc:
+gcc-gdc:
+gcc-gdc:
diff --git a/testing/source/gcc/slack-desc.gcc-gfortran b/testing/source/gcc/slack-desc.gcc-gfortran
new file mode 100644
index 000000000..6d08f0125
--- /dev/null
+++ b/testing/source/gcc/slack-desc.gcc-gfortran
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|' on
+# the right side marks the last column you can put a character in. You must make
+# exactly 11 lines for the formatting to be correct. It's also customary to
+# leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+gcc-gfortran: gcc-gfortran (Fortran support for GCC)
+gcc-gfortran:
+gcc-gfortran: The GNU Fortran compiler is fully compliant with the Fortran 95
+gcc-gfortran: Standard and includes legacy F77 support. In addition, a significant
+gcc-gfortran: number of Fortran 2003 and Fortran 2008 features are implemented.
+gcc-gfortran: GNU Fortran also contains many standard and extensions and can be
+gcc-gfortran: used to run real-world programs.
+gcc-gfortran:
+gcc-gfortran: This package contains those parts of the compiler collection
+gcc-gfortran: needed to compile Fortran code.
+gcc-gfortran:
diff --git a/testing/source/gcc/slack-desc.gcc-gnat b/testing/source/gcc/slack-desc.gcc-gnat
new file mode 100644
index 000000000..8994a0534
--- /dev/null
+++ b/testing/source/gcc/slack-desc.gcc-gnat
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|' on
+# the right side marks the last column you can put a character in. You must make
+# exactly 11 lines for the formatting to be correct. It's also customary to
+# leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+gcc-gnat: gcc-gnat (Ada support for GCC)
+gcc-gnat:
+gcc-gnat: Ada support for the GNU Compiler Collection.
+gcc-gnat:
+gcc-gnat: This package contains those parts of the compiler collection needed to
+gcc-gnat: compile Ada code. GNAT implements Ada 95, Ada 2005, Ada 2012 and Ada
+gcc-gnat: 2022, and it may also be invoked in Ada 83 compatibility mode.
+gcc-gnat: By default, GNAT assumes Ada 2012.
+gcc-gnat:
+gcc-gnat:
+gcc-gnat:
diff --git a/testing/source/gcc/slack-desc.gcc-go b/testing/source/gcc/slack-desc.gcc-go
new file mode 100644
index 000000000..297396cc4
--- /dev/null
+++ b/testing/source/gcc/slack-desc.gcc-go
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|' on
+# the right side marks the last column you can put a character in. You must make
+# exactly 11 lines for the formatting to be correct. It's also customary to
+# leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+gcc-go: gcc-go (Go support for GCC)
+gcc-go:
+gcc-go: Go is a compiled, garbage-collected, concurrent programming language
+gcc-go: developed by Google Inc. The initial design of Go was started in
+gcc-go: September 2007 by Robert Griesemer, Rob Pike, and Ken Thompson.
+gcc-go: Rob Pike has stated that Go is being used "for real stuff" at Google.
+gcc-go: Go's "gc" compiler targets the Linux, Mac OS X, FreeBSD, OpenBSD and
+gcc-go: Microsoft Windows operating systems, and the i386, amd64, and ARM
+gcc-go: processor architectures.
+gcc-go:
+gcc-go: Homepage: http://golang.org
diff --git a/testing/source/gcc/slack-desc.gcc-objc b/testing/source/gcc/slack-desc.gcc-objc
new file mode 100644
index 000000000..ac48f8bdc
--- /dev/null
+++ b/testing/source/gcc/slack-desc.gcc-objc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|' on
+# the right side marks the last column you can put a character in. You must make
+# exactly 11 lines for the formatting to be correct. It's also customary to
+# leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+gcc-objc: gcc-objc (Objective-C/C++ support for GCC)
+gcc-objc:
+gcc-objc: Objective-C/C++ support for the GNU Compiler Collection.
+gcc-objc:
+gcc-objc: This package contains those parts of the compiler collection needed to
+gcc-objc: compile code written in Objective-C and Objective-C++. Objective-C was
+gcc-objc: originally developed to add object-oriented extensions to the C
+gcc-objc: language, and is best known as the native language of the NeXT
+gcc-objc: computer.
+gcc-objc:
+gcc-objc: