about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2020-06-28 17:40:26 +0200
committerAlyssa Ross <hi@alyssa.is>2020-11-27 13:27:22 +0000
commit778e3a44254f5c1173fd88762f7b4e131ab16225 (patch)
treee7fc35088be8f64f4508ba8926c5a7a3ee11c5fa
parente397696f39d9406f4fb8d650261e34d7f2032da2 (diff)
downloadnixlib-778e3a44254f5c1173fd88762f7b4e131ab16225.tar
nixlib-778e3a44254f5c1173fd88762f7b4e131ab16225.tar.gz
nixlib-778e3a44254f5c1173fd88762f7b4e131ab16225.tar.bz2
nixlib-778e3a44254f5c1173fd88762f7b4e131ab16225.tar.lz
nixlib-778e3a44254f5c1173fd88762f7b4e131ab16225.tar.xz
nixlib-778e3a44254f5c1173fd88762f7b4e131ab16225.tar.zst
nixlib-778e3a44254f5c1173fd88762f7b4e131ab16225.zip
gcc49: fix build w/glibc-2.31
The same `libsanitizer` problem as in llvm<10 and newer GCCs.

https://hydra.nixos.org/build/122902814
https://hydra.nixos.org/build/122903349
(cherry picked from commit 114f97e77e0f9bba09edf2251963495a41baeb64)
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc/4.9/default.nix1
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc/4.9/libsanitizer.patch24
2 files changed, 25 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/compilers/gcc/4.9/default.nix b/nixpkgs/pkgs/development/compilers/gcc/4.9/default.nix
index 1c6907b271aa..98d4b61648e3 100644
--- a/nixpkgs/pkgs/development/compilers/gcc/4.9/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gcc/4.9/default.nix
@@ -63,6 +63,7 @@ let majorVersion = "4";
 
     patches =
       [ ../use-source-date-epoch.patch ../parallel-bconfig.patch ./parallel-strsignal.patch
+        ./libsanitizer.patch
         (fetchpatch {
           name = "avoid-ustat-glibc-2.28.patch";
           url = "https://gitweb.gentoo.org/proj/gcc-patches.git/plain/4.9.4/gentoo/100_all_avoid-ustat-glibc-2.28.patch?id=55fcb515620a8f7d3bb77eba938aa0fcf0d67c96";
diff --git a/nixpkgs/pkgs/development/compilers/gcc/4.9/libsanitizer.patch b/nixpkgs/pkgs/development/compilers/gcc/4.9/libsanitizer.patch
new file mode 100644
index 000000000000..f1a438a4e5f0
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/gcc/4.9/libsanitizer.patch
@@ -0,0 +1,24 @@
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+index aec950454..5bda9b3a3 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+@@ -156,18 +156,13 @@ namespace __sanitizer {
+ #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)