2023-12-18 22:58:25 +01:00
|
|
|
|
# Maintainer of official package: Felix Yan <felixonmars@archlinux.org>
|
|
|
|
|
|
|
|
|
|
pkgname=mingw-w64-gcc
|
2024-05-12 12:01:34 +02:00
|
|
|
|
pkgver=14.1.1+r1+g43b730b9134
|
2024-05-14 20:40:22 +02:00
|
|
|
|
pkgrel=2
|
2023-12-18 22:58:25 +01:00
|
|
|
|
pkgdesc="Cross GCC for the MinGW-w64 cross-compiler"
|
|
|
|
|
arch=('x86_64' 'aarch64')
|
|
|
|
|
url="https://gcc.gnu.org"
|
|
|
|
|
license=('GPL' 'LGPL' 'FDL' 'custom')
|
|
|
|
|
groups=('mingw-w64-toolchain' 'mingw-w64')
|
|
|
|
|
depends=('zlib' 'libisl' 'libmpc' 'mingw-w64-crt' 'mingw-w64-binutils' 'mingw-w64-winpthreads' 'mingw-w64-headers')
|
|
|
|
|
# gcc-d doesn't build as of 13.1.0
|
|
|
|
|
makedepends=("gcc-ada" "git")
|
|
|
|
|
options=('!strip' 'staticlibs' '!emptydirs' '!buildflags')
|
2024-05-12 12:01:34 +02:00
|
|
|
|
_commit=43b730b9134af60a8f1c5b107d625f7127ff23c5
|
2024-05-14 20:40:22 +02:00
|
|
|
|
source=(git+https://sourceware.org/git/gcc.git#commit=${_commit}
|
|
|
|
|
0001-missing-__thiscall-attribute-on-builtin-declaration-of-__cxa_thread_atexit.patch)
|
2023-12-18 22:58:25 +01:00
|
|
|
|
#source=(https://ftp.gnu.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz{,.sig})
|
|
|
|
|
validpgpkeys=(F3691687D867B81B51CE07D9BBE43771487328A9 # bpiotrowski@archlinux.org
|
|
|
|
|
86CFFCA918CF3AF47147588051E8B148A9999C34 # evangelos@foutrelis.com
|
|
|
|
|
13975A70E63C361C73AE69EF6EEB81F8981C74C7 # richard.guenther@gmail.com
|
|
|
|
|
D3A93CAD751C2AF4F8C7AD516C35B99309B5FA62) # Jakub Jelinek <jakub@redhat.com>
|
2024-05-14 20:40:22 +02:00
|
|
|
|
sha512sums=('SKIP' 'SKIP')
|
2023-12-18 22:58:25 +01:00
|
|
|
|
|
|
|
|
|
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
|
|
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
|
ln -sf gcc-${pkgver/+/-} gcc
|
|
|
|
|
cd gcc
|
|
|
|
|
|
2024-05-14 20:40:22 +02:00
|
|
|
|
patch -p1 -i "$srcdir/0001-missing-__thiscall-attribute-on-builtin-declaration-of-__cxa_thread_atexit.patch"
|
|
|
|
|
|
2023-12-18 22:58:25 +01:00
|
|
|
|
# mmapio.c:69:14: error: implicit declaration of function ‘getpagesize’
|
|
|
|
|
sed -i 's|\-Werror||g' libbacktrace/configure
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
build() {
|
2024-05-12 12:01:34 +02:00
|
|
|
|
# Avoid errors due to implicit function declarations and similar issues (which are treated as errors as of GCC 14,
|
|
|
|
|
# see https://gcc.gnu.org/gcc-14/porting_to.html)
|
|
|
|
|
export CFLAGS_FOR_TARGET=-fpermissive
|
|
|
|
|
|
2023-12-18 22:58:25 +01:00
|
|
|
|
for _arch in ${_architectures}; do
|
|
|
|
|
mkdir -p "$srcdir"/build-${_arch} && cd "$srcdir"/build-${_arch}
|
|
|
|
|
"$srcdir"/gcc/configure --prefix=/usr --libexecdir=/usr/lib \
|
|
|
|
|
--target=${_arch} \
|
|
|
|
|
--with-bugurl=https://bugs.archlinux.org/ \
|
|
|
|
|
--enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ \
|
|
|
|
|
--enable-shared --enable-static \
|
|
|
|
|
--enable-threads=posix --enable-fully-dynamic-string \
|
|
|
|
|
--enable-libstdcxx-time=yes --enable-libstdcxx-filesystem-ts=yes \
|
|
|
|
|
--with-system-zlib --enable-cloog-backend=isl \
|
|
|
|
|
--enable-lto --enable-libgomp \
|
|
|
|
|
--disable-multilib --enable-checking=release \
|
|
|
|
|
--disable-sjlj-exceptions --with-dwarf2
|
|
|
|
|
make
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
package() {
|
|
|
|
|
for _arch in ${_architectures}; do
|
|
|
|
|
cd "$srcdir"/build-${_arch}
|
|
|
|
|
make DESTDIR="$pkgdir" install
|
|
|
|
|
${_arch}-strip "$pkgdir"/usr/${_arch}/lib/*.dll
|
|
|
|
|
strip "$pkgdir"/usr/bin/${_arch}-*
|
2024-05-12 12:01:34 +02:00
|
|
|
|
strip "$pkgdir"/usr/lib/gcc/${_arch}/*/{cc1*,collect2,gnat1,f951,lto*}
|
2023-12-18 22:58:25 +01:00
|
|
|
|
ln -s ${_arch}-gcc "$pkgdir"/usr/bin/${_arch}-cc
|
|
|
|
|
# mv dlls
|
|
|
|
|
mkdir -p "$pkgdir"/usr/${_arch}/bin/
|
|
|
|
|
mv "$pkgdir"/usr/${_arch}/lib/*.dll "$pkgdir"/usr/${_arch}/bin/
|
|
|
|
|
done
|
|
|
|
|
strip "$pkgdir"/usr/bin/*
|
|
|
|
|
# remove unnecessary files
|
|
|
|
|
rm -r "$pkgdir"/usr/share
|
|
|
|
|
rm "$pkgdir"/usr/lib/libcc1.*
|
|
|
|
|
}
|