summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorwtx2017-12-24 12:34:21 +0100
committerwtx2017-12-24 12:34:21 +0100
commitf91557b10e2979605175b3628efdac1b960a8940 (patch)
tree5cd5a2bb8088dc3663c017b71765ae02b9522186
parent54f8e626d2ada07cd1a8e8e349880eb59f61dac2 (diff)
downloadaur-f91557b10e2979605175b3628efdac1b960a8940.tar.gz
Compilation fix
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD4
-rw-r--r--libsanitizer.patch25
-rw-r--r--sigaltstack.patch15
-rw-r--r--ucontext_t.patch177
5 files changed, 222 insertions, 1 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 317413926784..013711536655 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -3,7 +3,7 @@
pkgbase = gcc49-alternative
pkgdesc = The GNU Compiler Collection 4.9 for multilib
pkgver = 4.9.3
- pkgrel = 2
+ pkgrel = 3
url = http://gcc.gnu.org
arch = x86_64
license = GPL
diff --git a/PKGBUILD b/PKGBUILD
index 2c904883cfe0..0d28234d87a6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -56,6 +56,9 @@ prepare() {
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure
patch -p1 -i ${startdir}/cfns.h.diff
+ patch -p1 -i ${startdir}/ucontext_t.patch
+ patch -p1 -i ${startdir}/sigaltstack.patch
+ patch -p1 -i ${startdir}/libsanitizer.patch
mkdir -p ${srcdir}/gcc-build
}
@@ -68,6 +71,7 @@ build() {
CFLAGS=${CFLAGS/-pipe/}
CXXFLAGS=${CXXFLAGS/-pipe/}
+ export LD_PRELOAD=/lib/libstdc++.so.6
${srcdir}/${_basedir}/configure --prefix=/usr/gcc49 --exec-prefix=/usr/gcc49 \
diff --git a/libsanitizer.patch b/libsanitizer.patch
new file mode 100644
index 000000000000..82a759a8156c
--- /dev/null
+++ b/libsanitizer.patch
@@ -0,0 +1,25 @@
+--- gcc-4.9.3/libsanitizer/asan/asan_linux.cc 2017-12-24 11:50:02.595136715 +0100
++++ gcc-4.9.3/libsanitizer/asan/asan_linux.cc 2017-12-24 11:51:26.313135917 +0100
+@@ -30,6 +30,11 @@
+ #include <unistd.h>
+ #include <unwind.h>
+
++#ifndef SIGSEGV
++ #define SIGSEGV 11
++#endif
++
++
+ #if !SANITIZER_ANDROID
+ // FIXME: where to get ucontext on Android?
+ #include <sys/ucontext.h>
+--- gcc-4.9.3/libsanitizer/tsan/tsan_platform_linux.cc 2013-12-05 10:18:38.000000000 +0100
++++ gcc-4.9.3/libsanitizer/tsan/tsan_platform_linux.cc 2017-12-24 12:07:18.449126836 +0100
+@@ -351,7 +351,7 @@ bool IsGlobalVar(uptr addr) {
+ // closes within glibc. The code is a pure hack.
+ int ExtractResolvFDs(void *state, int *fds, int nfd) {
+ int cnt = 0;
+- __res_state *statp = (__res_state*)state;
++ struct __res_state *statp = (struct __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/sigaltstack.patch b/sigaltstack.patch
new file mode 100644
index 000000000000..de6013e84091
--- /dev/null
+++ b/sigaltstack.patch
@@ -0,0 +1,15 @@
+--- gcc-4.9.3/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc 2013-12-05 11:28:59.000000000 +0100
++++ gcc-4.9.3/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc 2017-12-24 11:41:46.217141449 +0100
+@@ -67,6 +67,12 @@
+
+ COMPILER_CHECK(sizeof(SuspendedThreadID) == sizeof(pid_t));
+
++struct sigaltstack {
++ void *ss_sp;
++ int ss_flags;
++ size_t ss_size;
++};
++
+ namespace __sanitizer {
+ // This class handles thread suspending/unsuspending in the tracer thread.
+ class ThreadSuspender {
diff --git a/ucontext_t.patch b/ucontext_t.patch
new file mode 100644
index 000000000000..ed3f20e8e15e
--- /dev/null
+++ b/ucontext_t.patch
@@ -0,0 +1,177 @@
+diff -rup gcc-4.8.5_orig/libgcc/config/aarch64/linux-unwind.h gcc-4.8.5_do_diffa/libgcc/config/aarch64/linux-unwind.h
+--- gcc-4.8.5_orig/libgcc/config/aarch64/linux-unwind.h 2013-02-04 20:06:20.000000000 +0100
++++ gcc-4.8.5_do_diffa/libgcc/config/aarch64/linux-unwind.h 2017-12-22 10:25:38.533697563 +0100
+@@ -39,7 +39,7 @@ aarch64_fallback_frame_state (struct _Un
+ struct rt_sigframe
+ {
+ siginfo_t info;
+- struct ucontext uc;
++ ucontext_t uc;
+ };
+
+ struct rt_sigframe *rt_;
+Only in gcc-4.8.5_do_diffa/libgcc/config/aarch64: linux-unwind.h.bak
+diff -rup gcc-4.8.5_orig/libgcc/config/alpha/linux-unwind.h gcc-4.8.5_do_diffa/libgcc/config/alpha/linux-unwind.h
+--- gcc-4.8.5_orig/libgcc/config/alpha/linux-unwind.h 2013-02-04 20:06:20.000000000 +0100
++++ gcc-4.8.5_do_diffa/libgcc/config/alpha/linux-unwind.h 2017-12-22 10:25:31.719697628 +0100
+@@ -51,7 +51,7 @@ alpha_fallback_frame_state (struct _Unwi
+ {
+ struct rt_sigframe {
+ siginfo_t info;
+- struct ucontext uc;
++ ucontext_t uc;
+ } *rt_ = context->cfa;
+ sc = &rt_->uc.uc_mcontext;
+ }
+Only in gcc-4.8.5_do_diffa/libgcc/config/alpha: linux-unwind.h.bak
+diff -rup gcc-4.8.5_orig/libgcc/config/bfin/linux-unwind.h gcc-4.8.5_do_diffa/libgcc/config/bfin/linux-unwind.h
+--- gcc-4.8.5_orig/libgcc/config/bfin/linux-unwind.h 2013-02-04 20:06:20.000000000 +0100
++++ gcc-4.8.5_do_diffa/libgcc/config/bfin/linux-unwind.h 2017-12-22 10:26:38.745696988 +0100
+@@ -52,7 +52,7 @@ bfin_fallback_frame_state (struct _Unwin
+ void *puc;
+ char retcode[8];
+ siginfo_t info;
+- struct ucontext uc;
++ ucontext_t uc;
+ } *rt_ = context->cfa;
+
+ /* The void * cast is necessary to avoid an aliasing warning.
+Only in gcc-4.8.5_do_diffa/libgcc/config/bfin: linux-unwind.h.bak
+diff -rup gcc-4.8.5_orig/libgcc/config/i386/linux-unwind.h gcc-4.8.5_do_diffa/libgcc/config/i386/linux-unwind.h
+--- gcc-4.8.5_orig/libgcc/config/i386/linux-unwind.h 2013-02-04 20:06:20.000000000 +0100
++++ gcc-4.8.5_do_diffa/libgcc/config/i386/linux-unwind.h 2017-12-22 10:27:17.437696619 +0100
+@@ -58,7 +58,7 @@ x86_64_fallback_frame_state (struct _Unw
+ if (*(unsigned char *)(pc+0) == 0x48
+ && *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL)
+ {
+- struct ucontext *uc_ = context->cfa;
++ ucontext_t *uc_ = context->cfa;
+ /* The void * cast is necessary to avoid an aliasing warning.
+ The aliasing warning is correct, but should not be a problem
+ because it does not alias anything. */
+@@ -138,7 +138,7 @@ x86_fallback_frame_state (struct _Unwind
+ siginfo_t *pinfo;
+ void *puc;
+ siginfo_t info;
+- struct ucontext uc;
++ ucontext_t uc;
+ } *rt_ = context->cfa;
+ /* The void * cast is necessary to avoid an aliasing warning.
+ The aliasing warning is correct, but should not be a problem
+Only in gcc-4.8.5_do_diffa/libgcc/config/i386: linux-unwind.h.bak
+diff -rup gcc-4.8.5_orig/libgcc/config/libbid/bid_binarydecimal.c gcc-4.8.5_do_diffa/libgcc/config/libbid/bid_binarydecimal.c
+\ No newline at end of file
+diff -rup gcc-4.8.5_orig/libgcc/config/m68k/linux-unwind.h gcc-4.8.5_do_diffa/libgcc/config/m68k/linux-unwind.h
+--- gcc-4.8.5_orig/libgcc/config/m68k/linux-unwind.h 2013-02-04 20:06:20.000000000 +0100
++++ gcc-4.8.5_do_diffa/libgcc/config/m68k/linux-unwind.h 2017-12-22 10:26:44.988696929 +0100
+@@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTI
+ /* <sys/ucontext.h> is unfortunately broken right now. */
+ struct uw_ucontext {
+ unsigned long uc_flags;
+- struct ucontext *uc_link;
++ ucontext_t *uc_link;
+ stack_t uc_stack;
+ mcontext_t uc_mcontext;
+ unsigned long uc_filler[80];
+Only in gcc-4.8.5_do_diffa/libgcc/config/m68k: linux-unwind.h.bak
+diff -rup gcc-4.8.5_orig/libgcc/config/pa/linux-unwind.h gcc-4.8.5_do_diffa/libgcc/config/pa/linux-unwind.h
+--- gcc-4.8.5_orig/libgcc/config/pa/linux-unwind.h 2014-10-26 15:52:49.000000000 +0100
++++ gcc-4.8.5_do_diffa/libgcc/config/pa/linux-unwind.h 2017-12-22 10:25:44.588697505 +0100
+@@ -80,7 +80,7 @@ pa32_fallback_frame_state (struct _Unwin
+ struct sigcontext *sc;
+ struct rt_sigframe {
+ siginfo_t info;
+- struct ucontext uc;
++ ucontext_t uc;
+ } *frame;
+
+ /* rt_sigreturn trampoline:
+Only in gcc-4.8.5_do_diffa/libgcc/config/pa: linux-unwind.h.bak
+diff -rup gcc-4.8.5_orig/libgcc/config/sh/linux-unwind.h gcc-4.8.5_do_diffa/libgcc/config/sh/linux-unwind.h
+--- gcc-4.8.5_orig/libgcc/config/sh/linux-unwind.h 2013-02-04 20:06:20.000000000 +0100
++++ gcc-4.8.5_do_diffa/libgcc/config/sh/linux-unwind.h 2017-12-22 10:26:30.237697070 +0100
+@@ -83,7 +83,7 @@ shmedia_fallback_frame_state (struct _Un
+ siginfo_t *pinfo;
+ void *puc;
+ siginfo_t info;
+- struct ucontext uc;
++ ucontext_t uc;
+ } *rt_ = context->cfa;
+ /* The void * cast is necessary to avoid an aliasing warning.
+ The aliasing warning is correct, but should not be a problem
+@@ -180,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_
+ {
+ struct rt_sigframe {
+ siginfo_t info;
+- struct ucontext uc;
++ ucontext_t uc;
+ } *rt_ = context->cfa;
+ /* The void * cast is necessary to avoid an aliasing warning.
+ The aliasing warning is correct, but should not be a problem
+Only in gcc-4.8.5_do_diffa/libgcc/config/sh: linux-unwind.h.bak
+diff -rup gcc-4.8.5_orig/libgcc/config/tilepro/linux-unwind.h gcc-4.8.5_do_diffa/libgcc/config/tilepro/linux-unwind.h
+--- gcc-4.8.5_orig/libgcc/config/tilepro/linux-unwind.h 2013-02-04 20:06:20.000000000 +0100
++++ gcc-4.8.5_do_diffa/libgcc/config/tilepro/linux-unwind.h 2017-12-22 10:26:14.634697218 +0100
+@@ -61,7 +61,7 @@ tile_fallback_frame_state (struct _Unwin
+ struct rt_sigframe {
+ unsigned char save_area[C_ABI_SAVE_AREA_SIZE];
+ siginfo_t info;
+- struct ucontext uc;
++ ucontext_t uc;
+ } *rt_;
+
+ /* Return if this is not a signal handler. */
+Only in gcc-4.8.5_do_diffa/libgcc/config/tilepro: linux-unwind.h.bak
+diff -rup gcc-4.8.5_orig/libgcc/config/xtensa/linux-unwind.h gcc-4.8.5_do_diffa/libgcc/config/xtensa/linux-unwind.h
+--- gcc-4.8.5_orig/libgcc/config/xtensa/linux-unwind.h 2013-02-04 20:06:20.000000000 +0100
++++ gcc-4.8.5_do_diffa/libgcc/config/xtensa/linux-unwind.h 2017-12-22 10:25:51.457697439 +0100
+@@ -63,7 +63,7 @@ xtensa_fallback_frame_state (struct _Unw
+
+ struct rt_sigframe {
+ siginfo_t info;
+- struct ucontext uc;
++ ucontext_t uc;
+ } *rt_;
+
+ /* movi a2, __NR_rt_sigreturn; syscall */
+Only in gcc-4.8.5_do_diffa/libgcc/config/xtensa: linux-unwind.h.bak
+diff -rup gcc-4.8.5_orig/libiberty/configure gcc-4.8.5_do_diffa/libiberty/configure
+diff -rup gcc-4.8.5_orig/libjava/include/i386-signal.h gcc-4.8.5_do_diffa/libjava/include/i386-signal.h
+--- gcc-4.8.5_orig/libjava/include/i386-signal.h 2011-12-20 13:18:26.000000000 +0100
++++ gcc-4.8.5_do_diffa/libjava/include/i386-signal.h 2017-12-22 10:34:54.688692259 +0100
+@@ -29,7 +29,7 @@ static void _Jv_##_name (int, siginfo_t
+ #define HANDLE_DIVIDE_OVERFLOW \
+ do \
+ { \
+- struct ucontext *_uc = (struct ucontext *)_p; \
++ ucontext_t *_uc = (struct ucontext *)_p; \
+ gregset_t &_gregs = _uc->uc_mcontext.gregs; \
+ unsigned char *_eip = (unsigned char *)_gregs[REG_EIP]; \
+ \
+Only in gcc-4.8.5_do_diffa/libjava/include: i386-signal.h.bak
+diff -rup gcc-4.8.5_orig/libjava/include/s390-signal.h gcc-4.8.5_do_diffa/libjava/include/s390-signal.h
+--- gcc-4.8.5_orig/libjava/include/s390-signal.h 2011-01-03 21:52:22.000000000 +0100
++++ gcc-4.8.5_do_diffa/libjava/include/s390-signal.h 2017-12-22 10:34:42.860692372 +0100
+@@ -51,7 +51,7 @@ do \
+ struct \
+ { \
+ unsigned long int uc_flags; \
+- struct ucontext *uc_link; \
++ ucontext_t *uc_link; \
+ stack_t uc_stack; \
+ mcontext_t uc_mcontext; \
+ unsigned long sigmask[2]; \
+Only in gcc-4.8.5_do_diffa/libjava/include: s390-signal.h.bak
+diff -rup gcc-4.8.5_orig/libjava/include/x86_64-signal.h gcc-4.8.5_do_diffa/libjava/include/x86_64-signal.h
+--- gcc-4.8.5_orig/libjava/include/x86_64-signal.h 2013-01-04 13:49:55.000000000 +0100
++++ gcc-4.8.5_do_diffa/libjava/include/x86_64-signal.h 2017-12-22 10:34:48.788692315 +0100
+@@ -28,7 +28,7 @@ static void _Jv_##_name (int, siginfo_t
+ #define HANDLE_DIVIDE_OVERFLOW \
+ do \
+ { \
+- struct ucontext *_uc = (struct ucontext *)_p; \
++ ucontext_t *_uc = (struct ucontext *)_p; \
+ gregset_t &_gregs = _uc->uc_mcontext.gregs; \
+ unsigned char *_rip = (unsigned char *)_gregs[REG_RIP]; \
+ \
+Only in gcc-4.8.5_do_diffa/libjava/include: x86_64-signal.h.bak