Skip to content

Commit 85513d7

Browse files
committed
Exclude libc.a from loadArchive for android
1 parent 8db5299 commit 85513d7

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

flake.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

overlays/bootstrap.nix

+1
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ in {
318318
++ onAndroid (from "9.12.1" ./patches/ghc/ghc-9.12-static-linker-script-support.patch)
319319

320320
++ onAndroid (from "9.6" ./patches/ghc/ghc-9.6-COMPAT_R_ARM_PREL31.patch)
321+
++ onAndroid (from "9.10" ./patches/ghc/ghc-9.10-ignore-libc.patch)
321322
;
322323
in ({
323324
ghc8107 = traceWarnOld "8.10" (final.callPackage ../compiler/ghc {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/rts/linker/LoadArchive.c b/rts/linker/LoadArchive.c
2+
index 3c35a029a4..55d78160f5 100644
3+
--- a/rts/linker/LoadArchive.c
4+
+++ b/rts/linker/LoadArchive.c
5+
@@ -261,6 +261,12 @@ HsInt loadArchive_ (pathchar *path)
6+
DEBUG_LOG("start\n");
7+
DEBUG_LOG("Loading archive `%" PATH_FMT "'\n", path);
8+
9+
+ if (endsWithPath(path, "/libc.a")) {
10+
+ IF_DEBUG(linker,
11+
+ debugBelch("ignoring libc.a file %" PATH_FMT "\n", path));
12+
+ return 1; /* success */
13+
+ }
14+
+
15+
/* Check that we haven't already loaded this archive.
16+
Ignore requests to load multiple times */
17+
if (isAlreadyLoaded(path)) {

0 commit comments

Comments
 (0)