Skip to content

Commit

Permalink
fix some aarch64-musl libc loading issues (#2115)
Browse files Browse the repository at this point in the history
  • Loading branch information
angerman authored Nov 28, 2023
1 parent c713f94 commit 52a99ff
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions overlays/bootstrap.nix
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ in {
# ++ fromUntil "9.6.1" "9.10" ./patches/ghc/iserv-syms.patch
# Fix the bad fixups: https://gitlab.haskell.org/ghc/ghc/-/commit/2adc050857a9c1b992040fbfd55fbe65b2851b19
++ final.lib.optional (versionAtLeast "9.6" && versionLessThan "9.8" && final.stdenv.targetPlatform.isAarch64) ./patches/ghc/2adc050857a9c1b992040fbfd55fbe65b2851b19.patch
++ final.lib.optional (versionAtLeast "8.10.7" && versionLessThan "9.0" && final.stdenv.targetPlatform.isAarch64 && final.stdenv.targetPlatform.isMusl && final.stdenv.targetPlatform != final.stdenv.hostPlatform) ./patches/ghc/ghc-8.10-aarch64-musl-gettimeofday.patch
;
in ({
ghc865 = final.callPackage ../compiler/ghc (traceWarnOld "8.6" {
Expand Down
18 changes: 18 additions & 0 deletions overlays/patches/ghc/ghc-8.10-aarch64-musl-gettimeofday.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c
index e0901c3..05a4310 100644
--- a/rts/RtsSymbols.c
+++ b/rts/RtsSymbols.c
@@ -991,9 +991,13 @@
SymI_HasProto(cas) \
SymI_HasProto(_assertFail) \
SymI_HasProto(keepCAFs) \
+ SymI_NeedsProto(gettimeofday) \
+ SymI_HasProto(clock) \
RTS_USER_SIGNALS_SYMBOLS \
RTS_INTCHAR_SYMBOLS

+ // need gettimeofday, clock for split-mix; otherwise will segv when calling this from iserv :-/
+

// 64-bit support functions in libgcc.a
#if defined(__GNUC__) && SIZEOF_VOID_P <= 4 && !defined(_ABIN32)

0 comments on commit 52a99ff

Please sign in to comment.