diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 62 |
1 files changed, 34 insertions, 28 deletions
@@ -9,8 +9,7 @@ set -u _pkgver='4.6' pkgname="gcc${_pkgver//\./}-multilib" pkgver="${_pkgver}.4" -pkgrel=4 -#_ver=${pkgver%.*} +pkgrel='4' pkgdesc="The GNU Compiler Collection for multilib (${_pkgver}.x)" arch=('x86_64') url='http://gcc.gnu.org' @@ -28,7 +27,7 @@ source=( ) sha256sums=('35af16afa0b67af9b8eb15cafb76d2bc5f568540552522f5dc2c88dd45d977e8' '3492332fa78b545ff46c2b5293d17c63c122be6f8f6fa4798864b7d4572b0024' - '93b8865cb61f455df807de90f852dc488753d4309d7a1d8f7e7f1a4efe37ffa4') + '9f8c50a715a921d3d2c9d5809ac9592ca66f682b2cc496606ff6eb4de79d46b6') PKGEXT='.pkg.tar.gz' if [ -n "${_snapshot:-}" ]; then @@ -51,33 +50,19 @@ prepare() { sed -e 's@\./fixinc\.sh@-c true@' -i 'gcc/Makefile.in' # Update gcc.texi to gcc49 version, needed as of texinfo>=6.3 and possibly texinfo=6.2 - patch -p0 -c < "${srcdir}/gcc.texi.49.patch" + # diff -pNau5 gcc/doc/gcc.texi{,.49} > 'gcc.texi.49.patch' + patch -Nup0 -i "${srcdir}/gcc.texi.49.patch" #if [ "${CARCH}" = "x86_64" ]; then # : patch -Np1 -i "${srcdir}/gcc_pure64.patch" #fi patch -Np0 -i "${srcdir}/gcc-hash-style-both.patch" - echo "${pkgver}" > 'gcc/BASE-VER' - - # Doesn't like FORTIFY_SOURCE - CPPFLAGS="${CPPFLAGS//-D_FORTIFY_SOURCE=?/}" - - # Doesn't like -fstack-protector-strong - CFLAGS="${CFLAGS//-fstack-protector-strong/-fstack-protector}" - CXXFLAGS="${CXXFLAGS//-fstack-protector-strong/-fstack-protector}" + # fix build with glibc 2.26 + sed -e 's:\bstruct ucontext\b:ucontext_t:g' -i $(grep --include '*.[ch]' --include '*.cc' -lre '\bstruct ucontext\b') + sed -e 's:\bstruct sigaltstack\b:stack_t:g' -i $(grep --include '*.[ch]' --include '*.cc' -lre '\bstruct sigaltstack\b') - # using -pipe causes spurious test-suite failures - # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565 - CFLAGS="${CFLAGS/-pipe/}" - CXXFLAGS="${CXXFLAGS/-pipe/}" - - # Flags from new compilers that old compilers don't recognize - CFLAGS="${CFLAGS/-fno-plt/}" - CXXFLAGS="${CXXFLAGS/-fno-plt/}" - - CFLAGS="${CFLAGS/-Wformat-overflow=[0-9]/}" - CXXFLAGS="${CXXFLAGS/-Wformat-overflow=[0-9]/}" + echo "${pkgver}" > 'gcc/BASE-VER' rm -rf 'gcc-build' mkdir 'gcc-build' @@ -87,9 +72,29 @@ prepare() { build() { set -u - cd "${_basedir}/gcc-build" + if [ ! -s "${_basedir}/gcc-build/Makefile" ]; then + cd "${_basedir}" + + # Doesn't like FORTIFY_SOURCE + CPPFLAGS="${CPPFLAGS//-D_FORTIFY_SOURCE=?/}" + + # Doesn't like -fstack-protector-strong + CFLAGS="${CFLAGS//-fstack-protector-strong/-fstack-protector}" + CXXFLAGS="${CXXFLAGS//-fstack-protector-strong/-fstack-protector}" + + # using -pipe causes spurious test-suite failures + # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565 + CFLAGS="${CFLAGS/-pipe/}" + CXXFLAGS="${CXXFLAGS/-pipe/}" + + # Flags from new compilers that old compilers don't recognize + CFLAGS="${CFLAGS/-fno-plt/}" + CXXFLAGS="${CXXFLAGS/-fno-plt/}" + + CFLAGS="${CFLAGS/-Wformat-overflow=[0-9]/}" + CXXFLAGS="${CXXFLAGS/-Wformat-overflow=[0-9]/}" - if [ ! -s 'Makefile' ]; then + cd 'gcc-build' # The following options are one per line, mostly sorted so they are easy to diff compare to other gcc packages. ../configure \ --build="${CHOST}" \ @@ -127,9 +132,10 @@ build() { # CXX='g++-4.9' CC='gcc-4.9' fi + cd "${srcdir}/${_basedir}/gcc-build" local _nproc="$(nproc)"; _nproc=$((_nproc>8?8:_nproc)) #LD_PRELOAD='/usr/lib/libstdc++.so' \\ - nice make -s -j "${_nproc}" + nice make -j "${_nproc}" set +u } @@ -143,7 +149,7 @@ _fn_check() { ulimit -s 32768 # do not abort on error as some are "expected" - make -k check || : + make -j1 -k check || : "${srcdir}/${_basedir}/contrib/test_summary" set +u } @@ -154,7 +160,7 @@ package() { cd "${_basedir}/gcc-build" #LD_PRELOAD='/usr/lib/libstdc++.so' \\ - make -s -j1 DESTDIR="${pkgdir}" install + make -j1 DESTDIR="${pkgdir}" install if [ "${CARCH}" = 'x86_64' ]; then ## Move conflicting libraries |