about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2016-08-26 14:56:03 +0000
committerRobin Gloster <mail@glob.in>2016-08-26 14:57:46 +0000
commit77473cda6b5f9d7dc72a01df195536b14b2f9b02 (patch)
tree2ac5e0c82bceff568a129e703d52d4de0d687082
parente39a3237e6a24047304184e3d2da813683992e78 (diff)
downloadnixlib-77473cda6b5f9d7dc72a01df195536b14b2f9b02.tar
nixlib-77473cda6b5f9d7dc72a01df195536b14b2f9b02.tar.gz
nixlib-77473cda6b5f9d7dc72a01df195536b14b2f9b02.tar.bz2
nixlib-77473cda6b5f9d7dc72a01df195536b14b2f9b02.tar.lz
nixlib-77473cda6b5f9d7dc72a01df195536b14b2f9b02.tar.xz
nixlib-77473cda6b5f9d7dc72a01df195536b14b2f9b02.tar.zst
nixlib-77473cda6b5f9d7dc72a01df195536b14b2f9b02.zip
ghc: add relocation patch for all versions
-rw-r--r--pkgs/development/compilers/ghc/7.0.4.nix2
-rw-r--r--pkgs/development/compilers/ghc/7.10.2.nix2
-rw-r--r--pkgs/development/compilers/ghc/7.10.3.nix1
-rw-r--r--pkgs/development/compilers/ghc/7.2.2.nix2
-rw-r--r--pkgs/development/compilers/ghc/7.4.2.nix2
-rw-r--r--pkgs/development/compilers/ghc/7.6.3.nix2
-rw-r--r--pkgs/development/compilers/ghc/7.8.3.nix2
-rw-r--r--pkgs/development/compilers/ghc/7.8.4.nix2
-rw-r--r--pkgs/development/compilers/ghc/8.0.1.nix1
-rw-r--r--pkgs/development/compilers/ghc/head.nix1
-rw-r--r--pkgs/development/compilers/ghc/nokinds.nix2
-rw-r--r--pkgs/development/compilers/ghc/relocation.patch19
12 files changed, 34 insertions, 4 deletions
diff --git a/pkgs/development/compilers/ghc/7.0.4.nix b/pkgs/development/compilers/ghc/7.0.4.nix
index 7442c5ca53c8..099f1376c778 100644
--- a/pkgs/development/compilers/ghc/7.0.4.nix
+++ b/pkgs/development/compilers/ghc/7.0.4.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "1a9b78d9d66c9c21de6c0932e36bb87406a4856f1611bf83bd44539bdc6ed0ed";
   };
 
-  patches = [ ./fix-7.0.4-clang.patch ];
+  patches = [ ./fix-7.0.4-clang.patch ./relocation.patch ];
 
   buildInputs = [ ghc perl gmp ncurses ];
 
diff --git a/pkgs/development/compilers/ghc/7.10.2.nix b/pkgs/development/compilers/ghc/7.10.2.nix
index 2e96c999b9e0..e384a42a51f4 100644
--- a/pkgs/development/compilers/ghc/7.10.2.nix
+++ b/pkgs/development/compilers/ghc/7.10.2.nix
@@ -29,6 +29,8 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 hscolour ];
 
+  patches = [ ./relocation.patch ];
+
   enableParallelBuilding = true;
 
   outputs = [ "out" "doc" ];
diff --git a/pkgs/development/compilers/ghc/7.10.3.nix b/pkgs/development/compilers/ghc/7.10.3.nix
index c059a89bde3b..31cf0b3c8bde 100644
--- a/pkgs/development/compilers/ghc/7.10.3.nix
+++ b/pkgs/development/compilers/ghc/7.10.3.nix
@@ -23,6 +23,7 @@ stdenv.mkDerivation rec {
 
   patches = [
     docFixes
+    ./relocation.patch
     ./ghc-7.x-dont-pass-linker-flags-via-response-files.patch   # https://github.com/NixOS/nixpkgs/issues/10752
   ];
 
diff --git a/pkgs/development/compilers/ghc/7.2.2.nix b/pkgs/development/compilers/ghc/7.2.2.nix
index 06f7cb9af2c4..31cac49135fc 100644
--- a/pkgs/development/compilers/ghc/7.2.2.nix
+++ b/pkgs/development/compilers/ghc/7.2.2.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "0g87d3z9275dniaqzkf56qfgzp1msd89nqqhhm2gkc6iga072spz";
   };
 
-  patches = [ ./fix-7.2.2-clang.patch ];
+  patches = [ ./fix-7.2.2-clang.patch ./relocation.patch ];
 
   buildInputs = [ ghc perl gmp ncurses ];
 
diff --git a/pkgs/development/compilers/ghc/7.4.2.nix b/pkgs/development/compilers/ghc/7.4.2.nix
index c74461a064e6..63ce7ddfacc7 100644
--- a/pkgs/development/compilers/ghc/7.4.2.nix
+++ b/pkgs/development/compilers/ghc/7.4.2.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "0vc3zmxqi4gflssmj35n5c8idbvyrhd88abi50whbirwlf4i5vpj";
   };
 
-  patches = [ ./fix-7.4.2-clang.patch ];
+  patches = [ ./fix-7.4.2-clang.patch ./relocation.patch ];
 
   buildInputs = [ ghc perl gmp ncurses ];
 
diff --git a/pkgs/development/compilers/ghc/7.6.3.nix b/pkgs/development/compilers/ghc/7.6.3.nix
index 6ee629cc9804..5a933a23aa8b 100644
--- a/pkgs/development/compilers/ghc/7.6.3.nix
+++ b/pkgs/development/compilers/ghc/7.6.3.nix
@@ -17,7 +17,7 @@ in stdenv.mkDerivation rec {
     sha256 = "1669m8k9q72rpd2mzs0bh2q6lcwqiwd1ax3vrard1dgn64yq4hxx";
   };
 
-  patches = [ ./fix-7.6.3-clang.patch ];
+  patches = [ ./fix-7.6.3-clang.patch ./relocation.patch ];
 
   buildInputs = [ ghc perl gmp ncurses ];
 
diff --git a/pkgs/development/compilers/ghc/7.8.3.nix b/pkgs/development/compilers/ghc/7.8.3.nix
index 55f8655c7009..f631ad923560 100644
--- a/pkgs/development/compilers/ghc/7.8.3.nix
+++ b/pkgs/development/compilers/ghc/7.8.3.nix
@@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
     sha256 = "0n5rhwl83yv8qm0zrbaxnyrf8x1i3b6si927518mwfxs96jrdkdh";
   };
 
+  patches = [ ./relocation.patch ];
+
   buildInputs = [ ghc perl gmp ncurses ];
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/compilers/ghc/7.8.4.nix b/pkgs/development/compilers/ghc/7.8.4.nix
index 6e10b1443c8f..f41a1cf7d98d 100644
--- a/pkgs/development/compilers/ghc/7.8.4.nix
+++ b/pkgs/development/compilers/ghc/7.8.4.nix
@@ -9,6 +9,8 @@ stdenv.mkDerivation (rec {
     sha256 = "1i4254akbb4ym437rf469gc0m40bxm31blp6s1z1g15jmnacs6f3";
   };
 
+  patches = [ ./relocation.patch ];
+
   buildInputs = [ ghc perl gmp ncurses ];
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/compilers/ghc/8.0.1.nix b/pkgs/development/compilers/ghc/8.0.1.nix
index 8341fca9f42f..02a78f60550f 100644
--- a/pkgs/development/compilers/ghc/8.0.1.nix
+++ b/pkgs/development/compilers/ghc/8.0.1.nix
@@ -23,6 +23,7 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./ghc-8.x-dont-pass-linker-flags-via-response-files.patch  # https://github.com/NixOS/nixpkgs/issues/10752
+    ./relocation.patch
 
     # Fix https://ghc.haskell.org/trac/ghc/ticket/12130
     (fetchFilteredPatch { url = https://git.haskell.org/ghc.git/patch/4d71cc89b4e9648f3fbb29c8fcd25d725616e265; sha256 = "0syaxb4y4s2dc440qmrggb4vagvqqhb55m6mx12rip4i9qhxl8k0"; })
diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix
index 0f3b57949b7a..b214c1feb23e 100644
--- a/pkgs/development/compilers/ghc/head.nix
+++ b/pkgs/development/compilers/ghc/head.nix
@@ -18,6 +18,7 @@ in stdenv.mkDerivation rec {
 
   patches = [
     ./ghc-7.x-dont-pass-linker-flags-via-response-files.patch   # https://github.com/NixOS/nixpkgs/issues/10752
+    ./relocation.patch
   ];
 
   postUnpack = ''
diff --git a/pkgs/development/compilers/ghc/nokinds.nix b/pkgs/development/compilers/ghc/nokinds.nix
index ca0a78eb0b67..a041ff02f936 100644
--- a/pkgs/development/compilers/ghc/nokinds.nix
+++ b/pkgs/development/compilers/ghc/nokinds.nix
@@ -38,6 +38,8 @@ stdenv.mkDerivation rec {
     sha256 = "183l4v6aw52r3ydwl8bxg1lh3cwfakb35rpy6mjg23dqmqsynmcn";
   };
 
+  patches = [ ./relocation.patch ];
+
   postUnpack = ''
     pushd ghc-${builtins.substring 0 7 rev}
     echo ${version} >VERSION
diff --git a/pkgs/development/compilers/ghc/relocation.patch b/pkgs/development/compilers/ghc/relocation.patch
new file mode 100644
index 000000000000..c5b1f6c560da
--- /dev/null
+++ b/pkgs/development/compilers/ghc/relocation.patch
@@ -0,0 +1,19 @@
+diff --git a/rts/Linker.c b/rts/Linker.c
+--- a/rts/Linker.c
++++ b/rts/Linker.c
+@@ -5681,7 +5681,13 @@
+           *(Elf64_Sword *)P = (Elf64_Sword)value;
+ #endif
+           break;
+-
++/* These two relocations were introduced in glibc 2.23 and binutils 2.26.
++    But in order to use them the system which compiles the bindist for GHC needs
++    to have glibc >= 2.23. So only use them if they're defined. */
++#if defined(R_X86_64_REX_GOTPCRELX) && defined(R_X86_64_GOTPCRELX)
++      case R_X86_64_REX_GOTPCRELX:
++      case R_X86_64_GOTPCRELX:
++#endif
+       case R_X86_64_GOTPCREL:
+       {
+           StgInt64 gotAddress = (StgInt64) &makeSymbolExtra(oc, ELF_R_SYM(info), S)->addr;
+