diff --git a/gcc/PKGBUILD b/gcc/PKGBUILD new file mode 100644 index 0000000..9e7cf84 --- /dev/null +++ b/gcc/PKGBUILD @@ -0,0 +1,141 @@ +# This is an example PKGBUILD file. Use this as a start to creating your own, +# and remove these comments. For more information, see 'man PKGBUILD'. +# NOTE: Please fill out the license field for your package! If it is unknown, +# then please put 'unknown'. + +# Maintainer: Future Linux Team +pkgname=(gcc gcc-libs gcc-libs-32bit) +pkgbase=gcc +pkgver=14.2.0 +pkgrel=1 +pkgdesc="The GNU Compiler Collection" +arch=('x86_64') +url="https://gcc.gnu.org" +license=('GPL-3.0-with-GCC-exception' 'GFDL-1.3-or-later') +makedepends=('binutils' 'mpc' 'isl' 'python' 'zstd') +options=('!emptydirs' '!lto') +source=(https://ftp.gnu.org/gnu/${pkgname}/${pkgbase}-${pkgver}/${pkgbase}-${pkgver}.tar.xz + c89 + c99) +sha256sums=(a7b39bc69cbf9e25826c5a60ab26477001f7c08d85cec04bc0e29cabed6f3cc9 + aa3327fd8626acf2a28fa75c0b3ed99fcffb1bbcbe6974505f050ee751ba4154 + 2861971c0ef2c011ce10c98e8cf7b5fd1d3d3c4eddcfe0a01ed9d76940f67638) + +prepare() { + cd ${pkgbase}-${pkgver} + + sed -e '/m32=/s/m32=.*/m32=..\/lib32$(call if_multiarch,:i386-linux-gnu)/' \ + -i.orig gcc/config/i386/t-linux64 + + install -dm755 ${pkgbase}-build +} + +build() { + cd ${pkgbase}-${pkgver}/${pkgbase}-build + + CFLAGS=${CFLAGS/-Werror=format-security/} + CXXFLAGS=${CXXFLAGS/-Werror=format-security/} + + mlist=m64,m32 + ${BUILD_CONFIGURE} \ + --target=${CHOST} \ + LD=ld \ + --enable-languages=c,c++ \ + --enable-default-pie \ + --enable-default-ssp \ + --enable-host-pie \ + --enable-multilib \ + --with-multilib-list=$mlist \ + --disable-bootstrap \ + --disable-fixincludes \ + --with-system-zlib + + make +} + +package_gcc() { + pkgdesc="The GNU Compiler Collection - C and C++ frontends" + groups=('base-devel') + depends=("${pkgbase}-libs=${pkgver}-${pkgrel}" 'binutils' 'mpc' 'isl' 'zstd') + options=('!emptydirs' 'staticlibs') + + cd ${pkgbase}-${pkgver}/${pkgbase}-build + + make DESTDIR=${pkgdir} install + + chown -v -R root:root ${pkgdir}/usr/lib64/gcc/${CHOST}/${pkgver}/include{,-fixed} + + ln -sv gcc.1 ${pkgdir}/usr/share/man/man1/cc.1 + + install -vdm 755 ${pkgdir}/usr/lib64/bfd-plugins + ln -sfv /usr/libexec/gcc/${CHOST}/${pkgver}/liblto_plugin.so \ + ${pkgdir}/usr/lib64/bfd-plugins/ + + install -d ${pkgdir}/usr/share/gdb/auto-load/usr/lib64 + mv ${pkgdir}/usr/lib64/*gdb.py ${pkgdir}/usr/share/gdb/auto-load/usr/lib64/ + + ln -s gcc ${pkgdir}/usr/bin/cc + + ln -svr cpp ${pkgdir}/usr/lib64 + + install -Dm755 ${srcdir}/c89 ${pkgdir}/usr/bin/c89 + install -Dm755 ${srcdir}/c99 ${pkgdir}/usr/bin/c99 + + _pick gcc_libs ${pkgdir}/usr/lib64/libasan.so + _pick gcc_libs ${pkgdir}/usr/lib64/libasan.so.8 + _pick gcc_libs ${pkgdir}/usr/lib64/libasan.so.8.0.0 + _pick gcc_libs ${pkgdir}/usr/lib64/libatomic.so + _pick gcc_libs ${pkgdir}/usr/lib64/libatomic.so.1 + _pick gcc_libs ${pkgdir}/usr/lib64/libatomic.so.1.2.0 + _pick gcc_libs ${pkgdir}/usr/lib64/libgcc_s.so + _pick gcc_libs ${pkgdir}/usr/lib64/libgcc_s.so.1 + + _pick gcc_libs ${pkgdir}/usr/lib64/libgomp.so + _pick gcc_libs ${pkgdir}/usr/lib64/libgomp.so.1 + _pick gcc_libs ${pkgdir}/usr/lib64/libgomp.so.1.0.0 + _pick gcc_libs ${pkgdir}/usr/lib64/libitm.so + _pick gcc_libs ${pkgdir}/usr/lib64/libitm.so.1 + _pick gcc_libs ${pkgdir}/usr/lib64/libitm.so.1.0.0 + _pick gcc_libs ${pkgdir}/usr/lib64/liblsan.so + _pick gcc_libs ${pkgdir}/usr/lib64/liblsan.so.0 + _pick gcc_libs ${pkgdir}/usr/lib64/liblsan.so.0.0.0 + _pick gcc_libs ${pkgdir}/usr/lib64/libquadmath.so + _pick gcc_libs ${pkgdir}/usr/lib64/libquadmath.so.0 + _pick gcc_libs ${pkgdir}/usr/lib64/libquadmath.so.0.0.0 + _pick gcc_libs ${pkgdir}/usr/lib64/libstdc++.so + _pick gcc_libs ${pkgdir}/usr/lib64/libstdc++.so.6 + _pick gcc_libs ${pkgdir}/usr/lib64/libstdc++.so.6.0.33 + _pick gcc_libs ${pkgdir}/usr/lib64/libtsan.so + _pick gcc_libs ${pkgdir}/usr/lib64/libtsan.so.2 + _pick gcc_libs ${pkgdir}/usr/lib64/libtsan.so.2.0.0 + _pick gcc_libs ${pkgdir}/usr/lib64/libubsan.so + _pick gcc_libs ${pkgdir}/usr/lib64/libubsan.so.1 + _pick gcc_libs ${pkgdir}/usr/lib64/libubsan.so.1.0.0 + _pick gcc_libs ${pkgdir}/usr/share/info/libgomp.info + _pick gcc_libs ${pkgdir}/usr/share/info/libitm.info + _pick gcc_libs ${pkgdir}/usr/share/info/libquadmath.info + _pick gcc_libs ${pkgdir}/usr/share/locale/de/LC_MESSAGES/libstdc++.mo + _pick gcc_libs ${pkgdir}/usr/share/locale/fr/LC_MESSAGES/libstdc++.mo + + _pick gcc_libs_32bit ${pkgdir}/usr/lib32 + +} + +package_gcc-libs() { + pkgdesc='Runtime libraries shipped by GCC' + groups=('base') + depends=('glibc') + options=('!emptydirs' '!strip') + + mv gcc_libs/* ${pkgdir} + +} + +package_gcc-libs-32bit() { + pkgdesc='32-bit runtime libraries shipped by GCC' + depends=('glibc-32bit') + options=('!emptydirs' '!strip') + + mv gcc_libs_32bit/* ${pkgdir} + +} diff --git a/gcc/c89 b/gcc/c89 new file mode 100644 index 0000000..6f1a1c3 --- /dev/null +++ b/gcc/c89 @@ -0,0 +1,13 @@ +#!/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/gcc/c99 b/gcc/c99 new file mode 100644 index 0000000..0da3b4a --- /dev/null +++ b/gcc/c99 @@ -0,0 +1,14 @@ +#!/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+"$@"} +