aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkhronosschoty <khronosschoty@posteo.org>2017-11-16 02:23:40 +0000
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-11-18 12:40:28 +0700
commit6f184386f29057548fc71bac170e885e71defe4a (patch)
tree781e7dbee758f9014067351f8a81cb9887de3132
parent2a57e2ce7dec54a5184691e4e00312191d93e0ac (diff)
development/gcclegacy494: Patched for glibc-2.26 (-current).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
-rw-r--r--development/gcclegacy494/942-asan-fix-missing-include-signal-h.patch36
-rw-r--r--development/gcclegacy494/943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch190
-rw-r--r--development/gcclegacy494/944-sanitizer-linux.patch88
-rw-r--r--development/gcclegacy494/gcclegacy494.SlackBuild126
4 files changed, 381 insertions, 59 deletions
diff --git a/development/gcclegacy494/942-asan-fix-missing-include-signal-h.patch b/development/gcclegacy494/942-asan-fix-missing-include-signal-h.patch
new file mode 100644
index 000000000000..5f00c04d2ba2
--- /dev/null
+++ b/development/gcclegacy494/942-asan-fix-missing-include-signal-h.patch
@@ -0,0 +1,36 @@
+From 205aa8e97bab553e5e6fe45896325e97962de704 Mon Sep 17 00:00:00 2001
+From: Rolf Eike Beer <eb@emlix.com>
+Date: Wed, 8 Feb 2017 11:42:52 +0100
+Subject: [PATCH] asan: fix missing include of signal.h
+
+This breaks when building gcc 4.9.4 / 5.4.0 with
+target_platform=powerpc-unknown-linux-gnu with glibc 2.25:
+
+../../../../gcc-host/libsanitizer/asan/asan_linux.cc: In function 'bool __asan::AsanInterceptsSignal(int)':
+../../../../gcc-host/libsanitizer/asan/asan_linux.cc:222:20: error: 'SIGSEGV' was not declared in this scope
+ return signum == SIGSEGV && common_flags()->handle_segv;
+
+This has been verified to apply to at least 4.9.4 and up to 5.4,
+the code has been reworked for gcc 6.
+
+Resolves (Buildroot) Bug: https://bugs.busybox.net/show_bug.cgi?id=10061
+
+Upstream: https://patchwork.ozlabs.org/patch/725596/
+
+Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
+---
+ libsanitizer/asan/asan_linux.cc | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libsanitizer/asan/asan_linux.cc b/libsanitizer/asan/asan_linux.cc
+index c504168..59087b9 100644
+--- a/libsanitizer/asan/asan_linux.cc
++++ b/libsanitizer/asan/asan_linux.cc
+@@ -29,6 +29,7 @@
+ #include <dlfcn.h>
+ #include <fcntl.h>
+ #include <pthread.h>
++#include <signal.h>
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <unwind.h>
diff --git a/development/gcclegacy494/943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch b/development/gcclegacy494/943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch
new file mode 100644
index 000000000000..526346c6f853
--- /dev/null
+++ b/development/gcclegacy494/943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch
@@ -0,0 +1,190 @@
+From b7e85069238c40eae54d0ca03ab6d5470d1815f9 Mon Sep 17 00:00:00 2001
+From: jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 4 Jul 2017 10:25:10 +0000
+Subject: [PATCH] Use ucontext_t not struct ucontext in linux-unwind.h files.
+
+Current glibc no longer gives the ucontext_t type the tag struct
+ucontext, to conform with POSIX namespace rules. This requires
+various linux-unwind.h files in libgcc, that were previously using
+struct ucontext, to be fixed to use ucontext_t instead. This is
+similar to the removal of the struct siginfo tag from siginfo_t some
+years ago.
+
+This patch changes those files to use ucontext_t instead. As the
+standard name that should be unconditionally safe, so this is not
+restricted to architectures supported by glibc, or conditioned on the
+glibc version.
+
+Tested compilation together with current glibc with glibc's
+build-many-glibcs.py.
+
+ * config/aarch64/linux-unwind.h (aarch64_fallback_frame_state),
+ config/alpha/linux-unwind.h (alpha_fallback_frame_state),
+ config/bfin/linux-unwind.h (bfin_fallback_frame_state),
+ config/i386/linux-unwind.h (x86_64_fallback_frame_state,
+ x86_fallback_frame_state), config/m68k/linux-unwind.h (struct
+ uw_ucontext), config/nios2/linux-unwind.h (struct nios2_ucontext),
+ config/pa/linux-unwind.h (pa32_fallback_frame_state),
+ config/sh/linux-unwind.h (sh_fallback_frame_state),
+ config/tilepro/linux-unwind.h (tile_fallback_frame_state),
+ config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Use
+ ucontext_t instead of struct ucontext.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@249958 138bc75d-0d04-0410-961f-82ee72b054a4
+[Romain backport from gcc-5-branch]
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ libgcc/config/aarch64/linux-unwind.h | 2 +-
+ libgcc/config/alpha/linux-unwind.h | 2 +-
+ libgcc/config/bfin/linux-unwind.h | 2 +-
+ libgcc/config/i386/linux-unwind.h | 4 ++--
+ libgcc/config/m68k/linux-unwind.h | 2 +-
+ libgcc/config/nios2/linux-unwind.h | 2 +-
+ libgcc/config/pa/linux-unwind.h | 2 +-
+ libgcc/config/sh/linux-unwind.h | 2 +-
+ libgcc/config/tilepro/linux-unwind.h | 2 +-
+ libgcc/config/xtensa/linux-unwind.h | 2 +-
+ 10 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/libgcc/config/aarch64/linux-unwind.h b/libgcc/config/aarch64/linux-unwind.h
+index 6b5b3cd..d13dc34 100644
+--- a/libgcc/config/aarch64/linux-unwind.h
++++ b/libgcc/config/aarch64/linux-unwind.h
+@@ -52,7 +52,7 @@ aarch64_fallback_frame_state (struct _Unwind_Context *context,
+ struct rt_sigframe
+ {
+ siginfo_t info;
+- struct ucontext uc;
++ ucontext_t uc;
+ };
+
+ struct rt_sigframe *rt_;
+diff --git a/libgcc/config/alpha/linux-unwind.h b/libgcc/config/alpha/linux-unwind.h
+index b5bfd1c..166d3d2 100644
+--- a/libgcc/config/alpha/linux-unwind.h
++++ b/libgcc/config/alpha/linux-unwind.h
+@@ -51,7 +51,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
+ {
+ struct rt_sigframe {
+ siginfo_t info;
+- struct ucontext uc;
++ ucontext_t uc;
+ } *rt_ = context->cfa;
+ sc = &rt_->uc.uc_mcontext;
+ }
+diff --git a/libgcc/config/bfin/linux-unwind.h b/libgcc/config/bfin/linux-unwind.h
+index dc58f0a..8b94568 100644
+--- a/libgcc/config/bfin/linux-unwind.h
++++ b/libgcc/config/bfin/linux-unwind.h
+@@ -52,7 +52,7 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
+ 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.
+diff --git a/libgcc/config/i386/linux-unwind.h b/libgcc/config/i386/linux-unwind.h
+index 7986928..a9d621c 100644
+--- a/libgcc/config/i386/linux-unwind.h
++++ b/libgcc/config/i386/linux-unwind.h
+@@ -58,7 +58,7 @@ x86_64_fallback_frame_state (struct _Unwind_Context *context,
+ 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_Context *context,
+ 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
+diff --git a/libgcc/config/m68k/linux-unwind.h b/libgcc/config/m68k/linux-unwind.h
+index 1ba2a0c4..d67767e 100644
+--- a/libgcc/config/m68k/linux-unwind.h
++++ b/libgcc/config/m68k/linux-unwind.h
+@@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ /* <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];
+diff --git a/libgcc/config/nios2/linux-unwind.h b/libgcc/config/nios2/linux-unwind.h
+index ba4bd80..8978868 100644
+--- a/libgcc/config/nios2/linux-unwind.h
++++ b/libgcc/config/nios2/linux-unwind.h
+@@ -38,7 +38,7 @@ struct nios2_mcontext {
+
+ struct nios2_ucontext {
+ unsigned long uc_flags;
+- struct ucontext *uc_link;
++ ucontext_t *uc_link;
+ stack_t uc_stack;
+ struct nios2_mcontext uc_mcontext;
+ sigset_t uc_sigmask; /* mask last for extensibility */
+diff --git a/libgcc/config/pa/linux-unwind.h b/libgcc/config/pa/linux-unwind.h
+index 4a3cfff..d2ac437 100644
+--- a/libgcc/config/pa/linux-unwind.h
++++ b/libgcc/config/pa/linux-unwind.h
+@@ -80,7 +80,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
+ struct sigcontext *sc;
+ struct rt_sigframe {
+ siginfo_t info;
+- struct ucontext uc;
++ ucontext_t uc;
+ } *frame;
+
+ /* rt_sigreturn trampoline:
+diff --git a/libgcc/config/sh/linux-unwind.h b/libgcc/config/sh/linux-unwind.h
+index 4875706..671bde7 100644
+--- a/libgcc/config/sh/linux-unwind.h
++++ b/libgcc/config/sh/linux-unwind.h
+@@ -180,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
+ {
+ 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
+diff --git a/libgcc/config/tilepro/linux-unwind.h b/libgcc/config/tilepro/linux-unwind.h
+index 27481cf..c24d58c 100644
+--- a/libgcc/config/tilepro/linux-unwind.h
++++ b/libgcc/config/tilepro/linux-unwind.h
+@@ -61,7 +61,7 @@ tile_fallback_frame_state (struct _Unwind_Context *context,
+ 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. */
+diff --git a/libgcc/config/xtensa/linux-unwind.h b/libgcc/config/xtensa/linux-unwind.h
+index 6832d0b..cb15b4c 100644
+--- a/libgcc/config/xtensa/linux-unwind.h
++++ b/libgcc/config/xtensa/linux-unwind.h
+@@ -63,7 +63,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
+
+ struct rt_sigframe {
+ siginfo_t info;
+- struct ucontext uc;
++ ucontext_t uc;
+ } *rt_;
+
+ /* movi a2, __NR_rt_sigreturn; syscall */
+--
+2.9.5
+
diff --git a/development/gcclegacy494/944-sanitizer-linux.patch b/development/gcclegacy494/944-sanitizer-linux.patch
new file mode 100644
index 000000000000..caadf2de7be9
--- /dev/null
+++ b/development/gcclegacy494/944-sanitizer-linux.patch
@@ -0,0 +1,88 @@
+From f9a35ba5c150da2e381c4cab01f8f12bcd6af5d2 Mon Sep 17 00:00:00 2001
+From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Mon, 17 Jul 2017 19:41:08 +0000
+Subject: [PATCH] Backported from mainline 2017-07-14 Jakub
+ Jelinek <jakub@redhat.com>
+
+ PR sanitizer/81066
+ * sanitizer_common/sanitizer_linux.h: Cherry-pick upstream r307969.
+ * sanitizer_common/sanitizer_linux.cc: Likewise.
+ * sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc: Likewise.
+ * tsan/tsan_platform_linux.cc: Likewise.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@250287 138bc75d-0d04-0410-961f-82ee72b054a4
+(cherry picked from commit 72edc2c02f8b4768ad660f46a1c7e2400c0a8e06)
+[Romain backport to 4.9.4]
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ libsanitizer/sanitizer_common/sanitizer_linux.cc | 3 +--
+ libsanitizer/sanitizer_common/sanitizer_linux.h | 4 +---
+ libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | 2 +-
+ libsanitizer/tsan/tsan_platform_linux.cc | 2 +-
+ 4 files changed, 4 insertions(+), 7 deletions(-)
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.cc b/libsanitizer/sanitizer_common/sanitizer_linux.cc
+index 69c9c10..8e53673 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_linux.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_linux.cc
+@@ -599,8 +599,7 @@ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5) {
+ return internal_syscall(__NR_prctl, option, arg2, arg3, arg4, arg5);
+ }
+
+-uptr internal_sigaltstack(const struct sigaltstack *ss,
+- struct sigaltstack *oss) {
++uptr internal_sigaltstack(const void *ss, void *oss) {
+ return internal_syscall(__NR_sigaltstack, (uptr)ss, (uptr)oss);
+ }
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.h b/libsanitizer/sanitizer_common/sanitizer_linux.h
+index 6422df1..8e111d1 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_linux.h
++++ b/libsanitizer/sanitizer_common/sanitizer_linux.h
+@@ -18,7 +18,6 @@
+ #include "sanitizer_platform_limits_posix.h"
+
+ struct link_map; // Opaque type returned by dlopen().
+-struct sigaltstack;
+
+ namespace __sanitizer {
+ // Dirent structure for getdents(). Note that this structure is different from
+@@ -28,8 +27,7 @@ struct linux_dirent;
+ // Syscall wrappers.
+ uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count);
+ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5);
+-uptr internal_sigaltstack(const struct sigaltstack* ss,
+- struct sigaltstack* oss);
++uptr internal_sigaltstack(const void* ss, void* oss);
+ uptr internal_sigaction(int signum, const __sanitizer_kernel_sigaction_t *act,
+ __sanitizer_kernel_sigaction_t *oldact);
+ uptr internal_sigprocmask(int how, __sanitizer_kernel_sigset_t *set,
+diff --git a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+index 6ee63ec..50c21a3 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
++++ b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+@@ -238,7 +238,7 @@ static int TracerThread(void* argument) {
+
+ // Alternate stack for signal handling.
+ InternalScopedBuffer<char> handler_stack_memory(kHandlerStackSize);
+- struct sigaltstack handler_stack;
++ stack_t handler_stack;
+ internal_memset(&handler_stack, 0, sizeof(handler_stack));
+ handler_stack.ss_sp = handler_stack_memory.data();
+ handler_stack.ss_size = kHandlerStackSize;
+diff --git a/libsanitizer/tsan/tsan_platform_linux.cc b/libsanitizer/tsan/tsan_platform_linux.cc
+index fe69430..49f5270 100644
+--- a/libsanitizer/tsan/tsan_platform_linux.cc
++++ b/libsanitizer/tsan/tsan_platform_linux.cc
+@@ -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];
+--
+2.9.5
+
diff --git a/development/gcclegacy494/gcclegacy494.SlackBuild b/development/gcclegacy494/gcclegacy494.SlackBuild
index 30cf14416277..3e148854f43b 100644
--- a/development/gcclegacy494/gcclegacy494.SlackBuild
+++ b/development/gcclegacy494/gcclegacy494.SlackBuild
@@ -24,7 +24,7 @@
PRGNAM=gcclegacy494
VERSION=${VERSION:-4.9.4}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
INSTLOC=${INSTLOC:-/opt/$PRGNAM}
@@ -47,58 +47,54 @@ if [ "$ARCH" = "i386" ]; then
LIBDIRSUFFIX=""
LIB_ARCH=i386
elif [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
- LIBDIRSUFFIX=""
- LIB_ARCH=i386
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+ LIB_ARCH=i386
elif [ "$ARCH" = "i586" ]; then
- SLKCFLAGS="-O2 -march=i586 -mtune=i686"
- LIBDIRSUFFIX=""
- LIB_ARCH=i386
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+ LIB_ARCH=i386
elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-O2 -march=i686"
- LIBDIRSUFFIX=""
- LIB_ARCH=i386
+ SLKCFLAGS="-O2 -march=i686"
+ LIBDIRSUFFIX=""
+ LIB_ARCH=i386
elif [ "$ARCH" = "s390" ]; then
- SLKCFLAGS="-O2"
- LIBDIRSUFFIX=""
- LIB_ARCH=s390
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+ LIB_ARCH=s390
elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC"
- LIBDIRSUFFIX="64"
- LIB_ARCH=amd64
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+ LIB_ARCH=amd64
elif [ "$ARCH" = "armv7hl" ]; then
- SLKCFLAGS="-O3 -march=armv7-a -mfpu=vfpv3-d16"
- LIBDIRSUFFIX=""
- LIB_ARCH=armv7hl
+ SLKCFLAGS="-O3 -march=armv7-a -mfpu=vfpv3-d16"
+ LIBDIRSUFFIX=""
+ LIB_ARCH=armv7hl
else
- SLKCFLAGS="-O2"
- LIBDIRSUFFIX=""
- LIB_ARCH=$ARCH
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+ LIB_ARCH=$ARCH
fi
-mkdir -p $TMP
-
case "$ARCH" in
arm*) TARGET=$ARCH-slackware-linux-gnueabi ;;
*) TARGET=$ARCH-slackware-linux ;;
esac
-if [ "$ARCH" != "x86_64" ]; then
- GCC_ARCHOPTS="--with-arch=$ARCH"
-else
+if [ "$ARCH" = "x86_64" ]; then
GCC_ARCHOPTS="--disable-multilib"
+else
+ GCC_ARCHOPTS="--with-arch=$ARCH"
fi
set -e
-cd $TMP/
-rm -rf gcc-4.9.4/
-tar -xzf $CWD/gcc-4.9.4.tar.gz
-cd gcc-4.9.4
-
-# Do not run fixincludes
-cp -v gcc/Makefile.in{,.orig}
-sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig > gcc/Makefile.in
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf gcc-$VERSION
+tar xvf $CWD/gcc-$VERSION.tar.gz
+cd gcc-$VERSION
tar xjf $CWD/mpfr-2.4.2.tar.bz2
ln -sf mpfr-2.4.2 mpfr
@@ -109,23 +105,35 @@ ln -sf mpc-0.8.1 mpc
tar xjf $CWD/isl-0.12.2.tar.bz2
ln -sf isl-0.12.2 isl
tar xzf $CWD/cloog-0.18.1.tar.gz
-ln -sf cloog-0.18.1 cloog
+ln -sf cloog-0.18.1 cloog
chown -R root:root .
find -L . \
-\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
- -o -perm 511 \) -exec chmod 755 {} \; -o \
-\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+# Do not run fixincludes
+cp -v gcc/Makefile.in{,.orig}
+sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig > gcc/Makefile.in
+
+# Apply patches if we are compiling against glibc 2.26
+if [ $(ldd --version | head -1) = 'ldd (GNU libc) 2.26' ]; then
+ patch -p1 -i "$CWD/942-asan-fix-missing-include-signal-h.patch"
+ patch -p1 -i "$CWD/943-Use-ucontext_t-not-struct-ucontext-in-linux-unwind.h.patch"
+ patch -p1 -i "$CWD/944-sanitizer-linux.patch"
+ export glibcxx_cv_c99_math=yes
+fi
+
rm -rf $TMP/objdir
mkdir $TMP/objdir
cd $TMP/objdir
-rm -rf $PKG
-mkdir -p $PKG
-CFLAGS="$SLKCFLAGS"
-CXXFLAGS="$SLKCFLAGS"
- $PWD/../gcc-4.9.4/configure --prefix=$INSTLOC \
- --program-suffix=-4.9.4 \
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+../gcc-$VERSION/configure --prefix=$INSTLOC \
+ --program-suffix=-$VERSION \
--enable-languages=c,c++ \
--with-system-zlib \
--libdir=$INSTLOC/lib$LIBDIRSUFFIX \
@@ -145,25 +153,25 @@ make DESTDIR=$PKG install-strip
# Thank you to 'idlemoor'
mkdir -p $PKG/usr/bin
-cd /$PKG/usr/bin
+cd $PKG/usr/bin
for COMPILER in gcc g++ ; do
- sed \
- -e "s~%LIBDIRSUFFIX%~$LIBDIRSUFFIX~" \
- -e "s~%COMPILER%~$COMPILER~" \
- -e "s~%INSTLOC%~$INSTLOC~" \
- < $CWD/wrapper.sh \
- > $PKG/usr/bin/$ARCH-slackware-linux-$COMPILER-4.9.4
- chmod ugo+x $PKG/usr/bin/$ARCH-slackware-linux-$COMPILER-4.9.4
+ sed \
+ -e "s~%LIBDIRSUFFIX%~$LIBDIRSUFFIX~" \
+ -e "s~%COMPILER%~$COMPILER~" \
+ -e "s~%INSTLOC%~$INSTLOC~" \
+ < $CWD/wrapper.sh \
+ > $PKG/usr/bin/$ARCH-slackware-linux-$COMPILER-$VERSION
+ chmod ugo+x $PKG/usr/bin/$ARCH-slackware-linux-$COMPILER-$VERSION
done
-ln -s $ARCH-slackware-linux-gcc-4.9.4 $PKG/usr/bin/gcc-4.9.4
-ln -s $ARCH-slackware-linux-g++-4.9.4 $PKG/usr/bin/g++-gcc-4.9.4
+ln -s $ARCH-slackware-linux-gcc-$VERSION $PKG/usr/bin/gcc-$VERSION
+ln -s $ARCH-slackware-linux-g++-$VERSION $PKG/usr/bin/g++-gcc-$VERSION
mv -f $PKG$INSTLOC/share/man $PKG/usr/man
cd $PKG/usr/man/man7
# we do not need these; according to "diff" there is no difference between these files
# and the ones Slackware ships with; except this man page named "gfdl.7"; which shall be
-# saved; and renamed so that it does not conflict with Slackware's.
-find . ! -name 'gfdl.7' -exec rm -rf {} \;
+# saved; and renamed so that it does not conflict with Slackware's.
+find . ! -name 'gfdl.7' -exec rm -rf {} \;
mv gfdl.7 gfdl494.7
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
@@ -172,7 +180,7 @@ mv -f $PKG$INSTLOC/share/info $PKG/usr/info
rm -f $PKG/usr/info/dir
cd $PKG/usr/info
#rename the .info files so they do not conflict with Slackware's own .info files.
-for info in *.info; do mv "$info" "${info%.*}-4.9.4.info"; done
+for info in *.info; do mv "$info" "${info%.*}-$VERSION.info"; done
gzip -9 $PKG/usr/info/*.info*
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION