Merge remote-tracking branch 'origin/master' into gcc-cross
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
From 2d03b6eaf823fc2db6a32b4a95e18f8a7474b47f Mon Sep 17 00:00:00 2001
|
||||
From: Maximilian Bosch <maximilian@mbosch.me>
|
||||
Date: Thu, 20 Feb 2020 01:56:42 +0100
|
||||
Subject: [PATCH] Fix build for glibc 2.31
|
||||
|
||||
---
|
||||
.../sanitizer_platform_limits_posix.cc | 5 +++--
|
||||
.../sanitizer_platform_limits_posix.h | 15 +--------------
|
||||
2 files changed, 4 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
|
||||
index 97eae3fc7..4089d4695 100644
|
||||
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
|
||||
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
|
||||
@@ -1145,8 +1145,9 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid);
|
||||
CHECK_SIZE_AND_OFFSET(ipc_perm, gid);
|
||||
CHECK_SIZE_AND_OFFSET(ipc_perm, cuid);
|
||||
CHECK_SIZE_AND_OFFSET(ipc_perm, cgid);
|
||||
-#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)
|
||||
-/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */
|
||||
+#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31)
|
||||
+/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit
|
||||
+ on many architectures. */
|
||||
CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
|
||||
#endif
|
||||
|
||||
diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
|
||||
index c13932283..3456fb2db 100644
|
||||
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
|
||||
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
|
||||
@@ -204,27 +204,14 @@ namespace __sanitizer {
|
||||
unsigned __seq;
|
||||
u64 __unused1;
|
||||
u64 __unused2;
|
||||
-#elif defined(__mips__) || defined(__aarch64__) || defined(__s390x__)
|
||||
- unsigned int mode;
|
||||
- unsigned short __seq;
|
||||
- unsigned short __pad1;
|
||||
- unsigned long __unused1;
|
||||
- unsigned long __unused2;
|
||||
#elif defined(__sparc__)
|
||||
-# if defined(__arch64__)
|
||||
unsigned mode;
|
||||
- unsigned short __pad1;
|
||||
-# else
|
||||
- unsigned short __pad1;
|
||||
- unsigned short mode;
|
||||
unsigned short __pad2;
|
||||
-# endif
|
||||
unsigned short __seq;
|
||||
unsigned long long __unused1;
|
||||
unsigned long long __unused2;
|
||||
#else
|
||||
- unsigned short mode;
|
||||
- unsigned short __pad1;
|
||||
+ unsigned int mode;
|
||||
unsigned short __seq;
|
||||
unsigned short __pad2;
|
||||
#if defined(__x86_64__) && !defined(_LP64)
|
||||
--
|
||||
2.25.0
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
, langObjCpp ? stdenv.targetPlatform.isDarwin
|
||||
, langGo ? false
|
||||
, profiledCompiler ? false
|
||||
, langJit ? false
|
||||
, staticCompiler ? false
|
||||
, enableShared ? true
|
||||
, enableLTO ? true
|
||||
@@ -52,6 +53,8 @@ let majorVersion = "7";
|
||||
./riscv-pthread-reentrant.patch
|
||||
# https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00297.html
|
||||
./riscv-no-relax.patch
|
||||
|
||||
./0001-Fix-build-for-glibc-2.31.patch
|
||||
]
|
||||
++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
|
||||
++ optionals targetPlatform.isNetBSD [
|
||||
@@ -90,7 +93,7 @@ stdenv.mkDerivation ({
|
||||
|
||||
inherit patches;
|
||||
|
||||
outputs = [ "out" "lib" "man" "info" ];
|
||||
outputs = [ "out" "man" "info" ] ++ stdenv.lib.optional (!langJit) "lib";
|
||||
setOutputFlags = false;
|
||||
NIX_NO_SELF_RPATH = true;
|
||||
|
||||
@@ -105,10 +108,10 @@ stdenv.mkDerivation ({
|
||||
--replace 'if (stdinc)' 'if (0)'
|
||||
|
||||
substituteInPlace libgcc/config/t-slibgcc-darwin \
|
||||
--replace "-install_name @shlib_slibdir@/\$(SHLIB_INSTALL_NAME)" "-install_name $lib/lib/\$(SHLIB_INSTALL_NAME)"
|
||||
--replace "-install_name @shlib_slibdir@/\$(SHLIB_INSTALL_NAME)" "-install_name ''${!outputLib}/lib/\$(SHLIB_INSTALL_NAME)"
|
||||
|
||||
substituteInPlace libgfortran/configure \
|
||||
--replace "-install_name \\\$rpath/\\\$soname" "-install_name $lib/lib/\\\$soname"
|
||||
--replace "-install_name \\\$rpath/\\\$soname" "-install_name ''${!outputLib}/lib/\\\$soname"
|
||||
'';
|
||||
|
||||
postPatch = ''
|
||||
@@ -209,6 +212,7 @@ stdenv.mkDerivation ({
|
||||
langGo
|
||||
langObjC
|
||||
langObjCpp
|
||||
langJit
|
||||
;
|
||||
} ++ optional (targetPlatform.isAarch64) "--enable-fix-cortex-a53-843419"
|
||||
++ optional targetPlatform.isNetBSD "--disable-libcilkrts"
|
||||
@@ -248,8 +252,8 @@ stdenv.mkDerivation ({
|
||||
(import ../common/extra-target-flags.nix {
|
||||
inherit stdenv crossStageStatic libcCross threadsCross;
|
||||
})
|
||||
EXTRA_TARGET_FLAGS
|
||||
EXTRA_TARGET_LDFLAGS
|
||||
EXTRA_FLAGS_FOR_TARGET
|
||||
EXTRA_LDFLAGS_FOR_TARGET
|
||||
;
|
||||
|
||||
passthru = {
|
||||
@@ -263,7 +267,7 @@ stdenv.mkDerivation ({
|
||||
inherit (stdenv) is64bit;
|
||||
|
||||
meta = {
|
||||
homepage = https://gcc.gnu.org/;
|
||||
homepage = "https://gcc.gnu.org/";
|
||||
license = stdenv.lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+
|
||||
description = "GNU Compiler Collection, version ${version}"
|
||||
+ (if stripped then "" else " (with debugging info)");
|
||||
|
||||
Reference in New Issue
Block a user