summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO4
-rw-r--r--0003-gcc-4.9-ustate.patch31
-rw-r--r--PKGBUILD16
3 files changed, 47 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b11c75752b0a..1ab20990a6a1 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = gcc49
pkgdesc = The GNU Compiler Collection
pkgver = 4.9.4
- pkgrel = 2
+ pkgrel = 3
url = http://gcc.gnu.org
arch = i686
arch = x86_64
@@ -21,12 +21,14 @@ pkgbase = gcc49
source = 0000-gcc-4.9.ucontext.patch
source = 0001-gcc-4.9-SIGSEGV.patch
source = 0002-gcc-4.9-__res_state.patch
+ source = 0003-gcc-4.9-ustate.patch
md5sums = 87c24a4090c1577ba817ec6882602491
md5sums = e039bfcfb6c2ab039b8ee69bf883e824
md5sums = e34fca0540d840e5d0f6427e98c92252
md5sums = 4a0dc704f1d92ceb4dd8608811241cec
md5sums = e787a03f0c38434490515a5823eca0b8
md5sums = c64d1e20274ff4fbfacdd11bef2e1273
+ md5sums = b27134678242f358c9b81cd73a1bcba1
pkgname = gcc49
diff --git a/0003-gcc-4.9-ustate.patch b/0003-gcc-4.9-ustate.patch
new file mode 100644
index 000000000000..064e0cf7717e
--- /dev/null
+++ b/0003-gcc-4.9-ustate.patch
@@ -0,0 +1,31 @@
+--- libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc 2013-12-19 13:54:11.000000000 +0100
++++ libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc 2018-09-16 15:23:46.141733145 +0200
+@@ -81,7 +81,6 @@
+ #include <sys/statvfs.h>
+ #include <sys/timex.h>
+ #include <sys/user.h>
+-#include <sys/ustat.h>
+ #include <linux/cyclades.h>
+ #include <linux/if_eql.h>
+ #include <linux/if_plip.h>
+@@ -163,7 +162,19 @@
+ unsigned struct_old_utsname_sz = sizeof(struct old_utsname);
+ unsigned struct_oldold_utsname_sz = sizeof(struct oldold_utsname);
+ unsigned struct_itimerspec_sz = sizeof(struct itimerspec);
+- unsigned struct_ustat_sz = sizeof(struct ustat);
++ // Use pre-computed size of struct ustat to avoid <sys/ustat.h> which
++ // has been removed from glibc 2.28.
++#if defined(__aarch64__) || defined(__s390x__) || defined (__mips64) \
++ || defined(__powerpc64__) || defined(__arch64__) || defined(__sparcv9) \
++ || defined(__x86_64__)
++#define SIZEOF_STRUCT_USTAT 32
++#elif defined(__arm__) || defined(__i386__) || defined(__mips__) \
++ || defined(__powerpc__) || defined(__s390__) || defined(__sparc__)
++#define SIZEOF_STRUCT_USTAT 20
++#else
++#error Unknown size of struct ustat
++#endif
++ unsigned struct_ustat_sz = SIZEOF_STRUCT_USTAT;
+ #endif // SANITIZER_LINUX
+
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
diff --git a/PKGBUILD b/PKGBUILD
index 636b38fbd917..015fb1f97aad 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,7 +8,7 @@ _pkgver_minor=4
pkgver=${_pkgver}.${_pkgver_minor}
_islver=0.12.2
_cloogver=0.18.1
-pkgrel=2
+pkgrel=3
pkgdesc="The GNU Compiler Collection"
arch=('i686' 'x86_64')
license=('GPL' 'LGPL' 'FDL' 'custom')
@@ -21,13 +21,15 @@ source=("ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2"
"ftp://gcc.gnu.org/pub/gcc/infrastructure/cloog-${_cloogver}.tar.gz"
"0000-gcc-4.9.ucontext.patch"
"0001-gcc-4.9-SIGSEGV.patch"
- "0002-gcc-4.9-__res_state.patch")
+ "0002-gcc-4.9-__res_state.patch"
+ "0003-gcc-4.9-ustate.patch")
md5sums=('87c24a4090c1577ba817ec6882602491'
'e039bfcfb6c2ab039b8ee69bf883e824'
'e34fca0540d840e5d0f6427e98c92252'
'4a0dc704f1d92ceb4dd8608811241cec'
'e787a03f0c38434490515a5823eca0b8'
- 'c64d1e20274ff4fbfacdd11bef2e1273')
+ 'c64d1e20274ff4fbfacdd11bef2e1273'
+ 'b27134678242f358c9b81cd73a1bcba1')
_basedir=gcc-${pkgver}
_libdir="usr/lib/gcc/$CHOST/$pkgver"
@@ -65,6 +67,8 @@ prepare() {
echo 'Failed to remove ^struct ucontext_t'
false
fi
+
+ patch -Nbup0 -i "${srcdir}/0003-gcc-4.9-ustate.patch"
mkdir ${srcdir}/gcc-build
}
@@ -80,6 +84,9 @@ build() {
# GCC 4.9 doesn't understand -fno-plt
CFLAGS=${CFLAGS/-fno-plt/}
CXXFLAGS=${CXXFLAGS/-fno-plt/}
+
+ # The GCC 4.9 library is otherwise found incorrectly zhen invoking host tools
+ export LD_PRELOAD=/usr/lib/libstdc++.so
${srcdir}/${_basedir}/configure --prefix=/usr \
--build=${CHOST} \
@@ -115,6 +122,9 @@ package()
{
cd ${srcdir}/gcc-build
+ # The GCC 4.9 library is otherwise found incorrectly zhen invoking host tools
+ export LD_PRELOAD=/usr/lib/libstdc++.so
+
make -j1 DESTDIR=${pkgdir} install
## Lazy way of dealing with conflicting man and info pages and locales...