You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit replaces the musl + glibc hackery in the GHC bindist
compiler by using the new musl based bindist that GHC HQ provides
(built on Alpine).
We could alternatively also use a nix-built musl boostrap compiler,
but it seems nicer to use the GHC HQ one for now.
This fixes the compiler built by
`pkgsMusl.haskell.compiler.ghc8102Binary` segfaulting (#118731)
since the commit
5e2311d - musl: 1.2.1 -> 1.2.2
concretely, musl commit
01c7920f - remove redundant pthread struct members repeated for layout purposes
which I suspect breaks some glibc/musl ABI compatibility that may have
existed accidentally until then.
The added
lib.optional stdenv.targetPlatform.isMusl "pie";
also fixes that the packaged bindist compiler cannot create a binary
in its `installCheck` phase (and overall); see detail explanation
in #129247.
# below, running ghc (e.g. during `installCheckPhase)` gives some apparently
260
+
# corrupted rpath or whatever makes the loader work on nonsensical strings:
261
+
# running install tests
262
+
# Error relocating /nix/store/...-ghc-8.10.2-binary/lib/ghc-8.10.5/bin/ghc: : symbol not found
263
+
# Error relocating /nix/store/...-ghc-8.10.2-binary/lib/ghc-8.10.5/bin/ghc: ir6zf6c9f86pfx8sr30n2vjy-ghc-8.10.2-binary/lib/ghc-8.10.5/bin/../lib/x86_64-linux-ghc-8.10.5/libHSexceptions-0.10.4-ghc8.10.5.so: symbol not found
264
+
# Error relocating /nix/store/...-ghc-8.10.2-binary/lib/ghc-8.10.5/bin/ghc: y/lib/ghc-8.10.5/bin/../lib/x86_64-linux-ghc-8.10.5/libHStemplate-haskell-2.16.0.0-ghc8.10.5.so: symbol not found
265
+
# Error relocating /nix/store/...-ghc-8.10.2-binary/lib/ghc-8.10.5/bin/ghc: 8.10.5/libHStemplate-haskell-2.16.0.0-ghc8.10.5.so: symbol not found
266
+
# Error relocating /nix/store/...-ghc-8.10.2-binary/lib/ghc-8.10.5/bin/ghc: �: symbol not found
267
+
# Error relocating /nix/store/...-ghc-8.10.2-binary/lib/ghc-8.10.5/bin/ghc: �?: symbol not found
268
+
# Error relocating /nix/store/...-ghc-8.10.2-binary/lib/ghc-8.10.5/bin/ghc: 64-linux-ghc-8.10.5/libHSexceptions-0.10.4-ghc8.10.5.so: symbol not found
269
+
# This is extremely bogus and should be investigated.
270
+
dontStrip=ifstdenv.hostPlatform.isMuslthentrueelsefalse;# `if` for explicitness
271
+
235
272
# On Linux, use patchelf to modify the executables so that they can
236
273
# find editline/gmp.
237
274
postFixup=lib.optionalStringstdenv.isLinux
@@ -279,13 +316,23 @@ stdenv.mkDerivation rec {
279
316
find $out -type f -name '*.p_o' -delete
280
317
find $out -type f -name '*.p_hi' -delete
281
318
find $out -type f -name '*_p.a' -delete
282
-
rm $out/lib/ghc-*/bin/ghc-iserv-prof
319
+
# `-f` because e.g. musl bindist does not have this file.
320
+
rm -f $out/lib/ghc-*/bin/ghc-iserv-prof
283
321
# Hydra will redistribute this derivation, so we have to keep the docs for
284
322
# legal reasons (retaining the legal notices etc)
285
323
# As a last resort we could unpack the docs separately and symlink them in.
286
324
# They're in $out/share/{doc,man}.
287
325
'';
288
326
327
+
# In nixpkgs, musl based builds currently enable `pie` hardening by default
328
+
# (see `defaultHardeningFlags` in `make-derivation.nix`).
329
+
# But GHC cannot currently produce outputs that are ready for `-pie` linking.
0 commit comments