summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO29
-rw-r--r--0000-gcc-5.4.ucontext.patch13
-rw-r--r--0001-gcc-5.4-SIGSEGV.patch10
-rw-r--r--0002-gcc-5.4-__res_state.patch11
-rw-r--r--PKGBUILD116
5 files changed, 179 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..751ba0321039
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,29 @@
+pkgbase = gcc54
+ pkgdesc = The GNU Compiler Collection (5.4.x)
+ pkgver = 5.4.0
+ pkgrel = 1
+ url = http://gcc.gnu.org
+ arch = i686
+ arch = x86_64
+ license = GPL
+ license = LGPL
+ license = FDL
+ license = custom
+ makedepends = binutils>=2.26
+ makedepends = libmpc
+ provides = gcc5
+ conflicts = gcc5
+ options = !emptydirs
+ source = ftp://gcc.gnu.org/pub/gcc/releases/gcc-5.4.0/gcc-5.4.0.tar.bz2
+ source = http://isl.gforge.inria.fr/isl-0.18.tar.bz2
+ source = 0000-gcc-5.4.ucontext.patch
+ source = 0001-gcc-5.4-SIGSEGV.patch
+ source = 0002-gcc-5.4-__res_state.patch
+ md5sums = 4c626ac2a83ef30dfb9260e6f59c2b30
+ md5sums = 11436d6b205e516635b666090b94ab32
+ md5sums = d5ad288e14234f7961daf5c14eb3dc27
+ md5sums = 6fb3aa8e209629efd48197cc1d3445e2
+ md5sums = 206f4389209e5475faaa4538a4cc567b
+
+pkgname = gcc54
+
diff --git a/0000-gcc-5.4.ucontext.patch b/0000-gcc-5.4.ucontext.patch
new file mode 100644
index 000000000000..7dc4da4f8532
--- /dev/null
+++ b/0000-gcc-5.4.ucontext.patch
@@ -0,0 +1,13 @@
+--- libsanitizer/sanitizer_common/sanitizer_linux.h.orig 2018-02-03 18:21:04.356118422 +0100
++++ libsanitizer/sanitizer_common/sanitizer_linux.h 2018-02-03 18:22:01.547962570 +0100
+@@ -16,9 +16,9 @@
+ #include "sanitizer_common.h"
+ #include "sanitizer_internal_defs.h"
+ #include "sanitizer_platform_limits_posix.h"
++#include <sys/ucontext.h>
+
+ struct link_map; // Opaque type returned by dlopen().
+-struct sigaltstack;
+
+ namespace __sanitizer {
+ // Dirent structure for getdents(). Note that this structure is different from
diff --git a/0001-gcc-5.4-SIGSEGV.patch b/0001-gcc-5.4-SIGSEGV.patch
new file mode 100644
index 000000000000..a75cacd5a5ce
--- /dev/null
+++ b/0001-gcc-5.4-SIGSEGV.patch
@@ -0,0 +1,10 @@
+--- libsanitizer/asan/asan_linux.cc.orig 2018-02-03 18:24:37.977222787 +0100
++++ libsanitizer/asan/asan_linux.cc 2018-02-03 18:25:03.873215178 +0100
+@@ -32,6 +32,7 @@
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <unwind.h>
++#include <signal.h>
+
+ #if SANITIZER_FREEBSD
+ #include <sys/link_elf.h>
diff --git a/0002-gcc-5.4-__res_state.patch b/0002-gcc-5.4-__res_state.patch
new file mode 100644
index 000000000000..e198be63bce8
--- /dev/null
+++ b/0002-gcc-5.4-__res_state.patch
@@ -0,0 +1,11 @@
+--- libsanitizer/tsan/tsan_platform_linux.cc.orig 2018-02-03 18:26:53.153703109 +0100
++++ libsanitizer/tsan/tsan_platform_linux.cc 2018-02-03 18:27:30.326068569 +0100
+@@ -377,7 +377,7 @@
+ int ExtractResolvFDs(void *state, int *fds, int nfd) {
+ #if SANITIZER_LINUX
+ int cnt = 0;
+- __res_state *statp = (__res_state*)state;
++ res_state statp = (res_state)state;
+ for (int i = 0; i < MAXNS && cnt < nfd; i++) {
+ if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1)
+ fds[cnt++] = statp->_u._ext.nssocks[i];
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..8a96d1bf25da
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,116 @@
+# $Id$
+# Maintainer: Michael Strecke <michael-strecke@hotmail.de>
+# Contributor: Sebastiaan Lokhorst <sebastiaanlokhorst@gmail.com>
+# Contributor: Ruben Van Boxem <vanboxem.ruben@gmail.com>
+# Contributor: Allan McRae <allan@archlinux.org>
+
+pkgname=('gcc54')
+pkgver=5.4.0
+_pkgver=5
+_islver=0.18
+pkgrel=1
+pkgdesc="The GNU Compiler Collection (5.4.x)"
+arch=('i686' 'x86_64')
+license=('GPL' 'LGPL' 'FDL' 'custom')
+url="http://gcc.gnu.org"
+makedepends=('binutils>=2.26' 'libmpc')
+options=('!emptydirs')
+provides=('gcc5')
+conflicts=('gcc5')
+source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2
+ http://isl.gforge.inria.fr/isl-${_islver}.tar.bz2
+ 0000-gcc-5.4.ucontext.patch
+ 0001-gcc-5.4-SIGSEGV.patch
+ 0002-gcc-5.4-__res_state.patch)
+md5sums=('4c626ac2a83ef30dfb9260e6f59c2b30'
+ '11436d6b205e516635b666090b94ab32'
+ 'd5ad288e14234f7961daf5c14eb3dc27'
+ '6fb3aa8e209629efd48197cc1d3445e2'
+ '206f4389209e5475faaa4538a4cc567b')
+
+_basedir=gcc-${pkgver}
+
+prepare() {
+ cd ${srcdir}/${_basedir}
+
+ # link isl for in-tree build
+ ln -s ../isl-${_islver} isl
+
+ # Do not run fixincludes
+ sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
+
+ # fix build with glibc 2.26
+ patch -Nbup0 -i "${srcdir}/0000-gcc-5.4.ucontext.patch" # https://gcc.gnu.org/bugzilla/attachment.cgi?id=41921
+ patch -Nbup0 -i "${srcdir}/0001-gcc-5.4-SIGSEGV.patch"
+ patch -Nbup0 -i "${srcdir}/0002-gcc-5.4-__res_state.patch" # https://gcc.gnu.org/bugzilla/attachment.cgi?id=41922
+ 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')
+ sed -e '/^struct ucontext_t/,/^};/ d' -i 'libsanitizer/tsan/tsan_interceptors.cc'
+ if grep -e '^struct ucontext_t' 'libsanitizer/tsan/tsan_interceptors.cc'; then
+ set +u
+ echo 'Failed to remove ^struct ucontext_t'
+ false
+ fi
+
+ # Arch Linux installs x86_64 libraries /lib
+ [[ $CARCH == "x86_64" ]] && sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
+
+ echo ${pkgver} > gcc/BASE-VER
+
+ # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
+ sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure
+
+ mkdir ${srcdir}/gcc-build
+}
+
+build() {
+ cd ${srcdir}/gcc-build
+
+ # using -pipe causes spurious test-suite failures
+ # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
+ CFLAGS=${CFLAGS/-pipe/}
+ CXXFLAGS=${CXXFLAGS/-pipe/}
+
+ # This option exist in default makepkg.conf while it's not supported by gcc5
+ CFLAGS=${CFLAGS/-fno-plt/}
+ CXXFLAGS=${CXXFLAGS/-fno-plt/}
+
+ ${srcdir}/${_basedir}/configure --prefix=/usr \
+ --build=${CHOST} \
+ --libdir=/usr/lib --libexecdir=/usr/lib \
+ --mandir=/usr/share/man --infodir=/usr/share/info \
+ --with-bugurl=https://bugs.archlinux.org/ \
+ --enable-languages=c,c++,fortran,go,lto,objc,obj-c++ \
+ --enable-shared --enable-threads=posix --enable-libmpx \
+ --with-system-zlib --with-isl --enable-__cxa_atexit \
+ --disable-libunwind-exceptions --enable-clocale=gnu \
+ --disable-libstdcxx-pch --disable-libssp \
+ --enable-gnu-unique-object --enable-linker-build-id \
+ --enable-lto --enable-plugin \
+ --with-linker-hash-style=gnu --enable-gnu-indirect-function \
+ --disable-multilib --disable-werror \
+ --enable-checking=release \
+ --program-suffix=-${_pkgver} \
+ --enable-version-specific-runtime-libs
+ #--enable-install-libiberty
+
+ export LD_PRELOAD=/usr/lib/libstdc++.so
+ make
+}
+
+package() {
+ cd ${srcdir}/gcc-build
+
+ make -j1 DESTDIR=${pkgdir} install
+
+ # Lazy way of dealing with conflicting files...
+ rm -rf ${pkgdir}/usr/share/{info,locale,man}
+
+ # Move potentially conflicting stuff to version specific subdirectory
+ [[ -d ${pkgdir}/usr/lib ]] && mv ${pkgdir}/usr/lib/lib* ${pkgdir}/usr/lib/gcc/${CHOST}/${pkgver}/
+ [[ -d ${pkgdir}/usr/lib/gcc/${CHOST}/lib/ ]] && mv ${pkgdir}/usr/lib/gcc/${CHOST}/lib/lib* ${pkgdir}/usr/lib/gcc/${CHOST}/${pkgver}/
+
+ # Install Runtime Library Exception
+ install -Dm644 ${srcdir}/${_basedir}/COPYING.RUNTIME \
+ ${pkgdir}/usr/share/licenses/$pkgname/RUNTIME.LIBRARY.EXCEPTION
+}