From e1ce53fde3609d07340270ea267d9b6ea987add6 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Thu, 9 May 2024 09:04:20 +0200 Subject: extra/gcc13: copied patched from gcc to gcc13 --- extra/gcc13/PKGBUILD | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 extra/gcc13/PKGBUILD (limited to 'extra/gcc13/PKGBUILD') diff --git a/extra/gcc13/PKGBUILD b/extra/gcc13/PKGBUILD new file mode 100644 index 00000000..ca003988 --- /dev/null +++ b/extra/gcc13/PKGBUILD @@ -0,0 +1,125 @@ +# remove tsan (thread sanitizer) plugin, not available for i686 +pkgname=( + $( + printf '%s\n' "${pkgname[@]}" | \ + grep -vFx 'lib32-gcc-libs' + ) +) +unset -f 'package_lib32-gcc-libs' +eval "$( + declare -f prepare | \ + sed ' + \,/s/lib64/lib/, d + ' + declare -f build | \ + sed ' + /configure/ s/--enable-multilib/--disable-multilib/ + /configure/ s,--with-bugurl=https://bugs\.archlinux\.org/,--with-bugurl=https://bugs.archlinux32.org/, + /configure/ s/;$/ --build=$CHOST;/ + ' + declare -f package_gcc-libs | \ + sed ' + s/\$pkgname-multilib// + s@libsanitizer/{a,l,ub,t}san@libsanitizer/{a,l,ub}san@ + /provides=/s/libtsan.so// + \@/usr/lib32/@ d + ' + declare -f package_gcc | \ + sed ' + s/"lib32-gcc-libs[^"]*"//g + s@make.*tsan.*install@#\0@ + ' + declare -f package_gcc-ada | \ + sed ' + \,cd .*/32/libada,{ + N + d + } + ' +)" +eval "$( + for name in "${pkgname[@]}"; do + declare -f package_${name} | \ + sed ' + s/$pkgname-multilib// + s/{,32}// + \,/lib32/,d + \,/32/,d + ' + done +)" + +# i486-specific + +# no ADA +makedepends=(${makedepends[@]//gcc-ada/}) +makedepends_i686+=('gcc-ada') +makedepends_pentium4+=('gcc-ada') + +if [ "${CARCH}" = "i486" ]; then + package_gcc-ada() { + touch "$pkgdir/this-is-a-dummy-package" + } + + eval "$( + declare -f build | \ + sed ' + /enable-languages/ s/ada,// + ' + )" + + eval "$( + declare -f package_gcc | \ + sed ' + s/,gnat-style,gnat_rm,gnat_ugn// + ' + )" + + # building toolchain (gcc): again, lobtool problems + # /usr/lib/gcc/i486-pc-linux-gnu/7.3.0/ld: cannot find -lquadmath + # collect2: error: ld returned 1 exit status + # libtool: install: error: relink `libgfortran.la' with the above command before installing it + # make: Leaving directory '/build/gcc/src/gcc-build/i486-pc-linux-gnu/libgfortran' + # => wrong link order: libgfortran requires libquadmath + eval "$( + declare -f package_gcc-libs | \ + sed ' + /for lib in / s/libgfortran/libquadmath libgfortran/ + ' + )" + +fi + +makedepends=(${makedepends[@]//lib32-glibc/}) +makedepends=(${makedepends[@]//lib32-gcc-libs/}) + +# i486-specific: disable PGO/LTO build, uses too much resources, +# also disabling LTO for now +if [ "${CARCH}" = "i486" ]; then + eval "$( + declare -f build | \ + sed ' + s/--enable-pgo-build=.*/--disable-pgo-build/ + s/--enable-lto/--disable-lto/ + s/--with-build-config=bootstrap-lto// + ' + declare -f package_gcc | \ + sed ' + /make.*lto-plugin.*install/d + /ln.*liblto_plugin.so/d + ' + )" +fi + +# testing on 486 VMs takes too long and runs in virtual memory exhaustion +if [ "${CARCH}" = "i486" ]; then + unset check +fi + +# disable CET on all subarchitectures (Control Flow instructions endbr32/enbr64) +eval "$( + declare -f build | \ + sed ' + s/--enable-cet=auto/--disable-cet/ + ' +)" -- cgit v1.2.3-70-g09d2