Skip to content

Commit 08efe5b

Browse files
committed
Define ELF64_ST_VISIBILITY and ELF32_ST_VISIBILITY for android
1 parent ea25d0b commit 08efe5b

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

overlays/bootstrap.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ in {
230230
++ onAndroid (fromUntil "9.0" "9.10" ./patches/ghc/ghc-9.6-hadrian-android.patch)
231231
++ onAndroid (from "9.10" ./patches/ghc/ghc-9.10-hadrian-android.patch)
232232
++ onAndroid (fromUntil "9.10" "9.11" ./patches/ghc/ghc-9.10-relax-llvm-max-version.patch)
233+
++ onAndroid (from "9.12" ./patches/ghc/ghc-define-undefined-elf-st-visibility.patch)
233234
++ onMusl (onAarch64 (fromUntil "9.4" "9.8" ./patches/ghc/ghc-9.6-hadrian-strip-cmd.patch))
234235
++ onMusl (onAarch64 (fromUntil "9.8" "9.10" ./patches/ghc/ghc-9.8-hadrian-strip-cmd.patch))
235236
++ onMusl (onAarch64 (fromUntil "9.10" "9.12" ./patches/ghc/ghc-9.10-hadrian-strip-cmd.patch))
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
diff --git a/rts/linker/ElfTypes.h b/rts/linker/ElfTypes.h
2+
index f5e2f819d9..7f75087738 100644
3+
--- a/rts/linker/ElfTypes.h
4+
+++ b/rts/linker/ElfTypes.h
5+
@@ -33,6 +33,9 @@
6+
#define Elf_Sym Elf64_Sym
7+
#define Elf_Rel Elf64_Rel
8+
#define Elf_Rela Elf64_Rela
9+
+#if !defined(ELF64_ST_VISIBILITY)
10+
+#define ELF64_ST_VISIBILITY(o) ((o)&0x3)
11+
+#endif
12+
#if !defined(ELF_ST_VISIBILITY)
13+
#define ELF_ST_VISIBILITY ELF64_ST_VISIBILITY
14+
#endif
15+
@@ -60,6 +63,9 @@
16+
#define Elf_Sym Elf32_Sym
17+
#define Elf_Rel Elf32_Rel
18+
#define Elf_Rela Elf32_Rela
19+
+#if !defined(ELF32_ST_VISIBILITY)
20+
+#define ELF32_ST_VISIBILITY(o) ((o)&0x3)
21+
+#endif
22+
#if !defined(ELF_ST_VISIBILITY)
23+
#define ELF_ST_VISIBILITY ELF32_ST_VISIBILITY
24+
#endif /* ELF_ST_VISIBILITY */

0 commit comments

Comments
 (0)