summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Matteo Bernardini2019-04-19 11:13:46 +0200
committer Matteo Bernardini2019-08-18 07:55:05 +0200
commit945c221c86c1445ca9615e6ccd8fadf3cbfd63bc (patch)
treea5cfd5d22b19c027c1b08147b21a9e9de79f401a
parentbefc4f7bdfb12bb710d59aaa116d6e7d6122dbdc (diff)
downloadslackbuilds-gcc5.tar.gz
development/gcc5: Patch for glibc-2.28.gcc5
Credit goes to luvr on LQ Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
-rw-r--r--development/gcc5/gcc5.SlackBuild7
-rw-r--r--development/gcc5/patches/glibc2.28-ustat.diff31
2 files changed, 36 insertions, 2 deletions
diff --git a/development/gcc5/gcc5.SlackBuild b/development/gcc5/gcc5.SlackBuild
index 7054b3184f..f9a03116c5 100644
--- a/development/gcc5/gcc5.SlackBuild
+++ b/development/gcc5/gcc5.SlackBuild
@@ -57,7 +57,7 @@ PRGNAM=gcc5
VERSION=${VERSION:-5.5.0}
MAJVER=$(echo ${VERSION} |cut -d. -f1)
BUILD=${BUILD:-1}
-TAG=${TAG:-SBo}
+TAG=${TAG:-_SBo}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -195,6 +195,9 @@ ANTLJAR=$(echo $CWD/antlr-*.jar | tail -1)
cat $CWD/patches/0009-x86-Disallow-mindirect-branch-mfunction-return-with-.diff | patch -p2 --verbose || exit 1
cat $CWD/patches/0009-x86-Disallow-mindirect-branch-mfunction-return-with-doc.diff | patch -p2 --verbose || exit 1
+ # Fix build with glibc 2.28, which no longer makes available header file <sys/ustat.h>
+ cat $CWD/patches/glibc2.28-ustat.diff | patch -p0 --verbose || exit 1
+
# Fix perms/owners
chown -R root:root .
find . -perm 777 -exec chmod 755 {} \;
@@ -434,7 +437,7 @@ fi
if [ ${MULTILIB} = "NO" ]; then
# Make our 64bit gcc look for 32bit gcc binaries in ./32 subdirectory:
- (only needed if gcc was compiled with disable-multilib)
+ # (only needed if gcc was compiled with disable-multilib)
if [ "$ARCH" = "x86_64" ]; then
sed -i 's#;.\(:../lib !m64 m32;\)$#;32\1#' \
$PKG/usr/lib${LIBDIRSUFFIX}/gcc/${TARGET}/${VERSION}/specs
diff --git a/development/gcc5/patches/glibc2.28-ustat.diff b/development/gcc5/patches/glibc2.28-ustat.diff
new file mode 100644
index 0000000000..c7d71d0677
--- /dev/null
+++ b/development/gcc5/patches/glibc2.28-ustat.diff
@@ -0,0 +1,31 @@
+--- libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc 2018/04/25 07:39:32 259630
++++ libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc 2018/05/24 20:07:25 260687
+@@ -138,7 +138,6 @@
+ # include <sys/procfs.h>
+ #endif
+ #include <sys/user.h>
+-#include <sys/ustat.h>
+ #include <linux/cyclades.h>
+ #include <linux/if_eql.h>
+ #include <linux/if_plip.h>
+@@ -231,7 +230,19 @@
+ #endif // SANITIZER_LINUX || SANITIZER_FREEBSD
+
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+- 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__)
++#define SIZEOF_STRUCT_USTAT 20
++#else
++#error Unknown size of struct ustat
++#endif
++ unsigned struct_ustat_sz = SIZEOF_STRUCT_USTAT;
+ unsigned struct_rlimit64_sz = sizeof(struct rlimit64);
+ unsigned struct_statvfs64_sz = sizeof(struct statvfs64);
+ #endif // SANITIZER_LINUX && !SANITIZER_ANDROID