Skip to content

Commit

Permalink
gcc: sync cflags/ldflags setup with Arch
Browse files Browse the repository at this point in the history
For details see https://bugs.archlinux.org/task/71777
In theory this should speed up the builds, let's see..

also enable parallel install while at it, this was disabled 10 years
ago without any comment
  • Loading branch information
lazka committed May 5, 2023
1 parent 7d11b57 commit 518e217
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions mingw-w64-gcc/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pkgver=13.1.0
#_majorver=${pkgver:0:1}
#_sourcedir=${_realname}-${_majorver}-${_snapshot}
_sourcedir=${_realname}-${pkgver}
pkgrel=1
pkgrel=2
pkgdesc="GCC for the MinGW-w64"
arch=('any')
mingw_arch=('mingw64' 'ucrt64')
Expand Down Expand Up @@ -258,11 +258,17 @@ build() {
sed -i 's,^STRIP_FOR_TARGET=.*$,STRIP_FOR_TARGET=true,g' Makefile
fi

make V=1 all
# https://gcc.gnu.org/onlinedocs/gccint/Makefile.html
# https://bugs.archlinux.org/task/71777
make -O STAGE1_CFLAGS="-O2" \
BOOT_CFLAGS="$CFLAGS" \
BOOT_LDFLAGS="$LDFLAGS" \
LDFLAGS_FOR_TARGET="$LDFLAGS" \
all

rm -rf ${srcdir}${MINGW_PREFIX}

make -j1 DESTDIR=${srcdir} install
make DESTDIR=${srcdir} install
if [ "$_enable_ada" == "yes" ]; then
mv ${srcdir}${MINGW_PREFIX}/lib/gcc/${MINGW_CHOST}/${pkgver%%+*}/adalib/*.dll ${srcdir}${MINGW_PREFIX}/bin/
fi
Expand Down

0 comments on commit 518e217

Please sign in to comment.