ghc: add relocation patch for all versions

This commit is contained in:
Robin Gloster 2016-08-26 14:56:03 +00:00
parent e39a3237e6
commit 77473cda6b
No known key found for this signature in database
GPG Key ID: 5E4C836C632C2882
12 changed files with 34 additions and 4 deletions

View File

@ -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 ];

View File

@ -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" ];

View File

@ -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
];

View File

@ -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 ];

View File

@ -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 ];

View File

@ -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 ];

View File

@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
sha256 = "0n5rhwl83yv8qm0zrbaxnyrf8x1i3b6si927518mwfxs96jrdkdh";
};
patches = [ ./relocation.patch ];
buildInputs = [ ghc perl gmp ncurses ];
enableParallelBuilding = true;

View File

@ -9,6 +9,8 @@ stdenv.mkDerivation (rec {
sha256 = "1i4254akbb4ym437rf469gc0m40bxm31blp6s1z1g15jmnacs6f3";
};
patches = [ ./relocation.patch ];
buildInputs = [ ghc perl gmp ncurses ];
enableParallelBuilding = true;

View File

@ -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"; })

View File

@ -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 = ''

View File

@ -38,6 +38,8 @@ stdenv.mkDerivation rec {
sha256 = "183l4v6aw52r3ydwl8bxg1lh3cwfakb35rpy6mjg23dqmqsynmcn";
};
patches = [ ./relocation.patch ];
postUnpack = ''
pushd ghc-${builtins.substring 0 7 rev}
echo ${version} >VERSION

View File

@ -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;