Skip to content

Commit

Permalink
Define ELF64_ST_VISIBILITY and ELF32_ST_VISIBILITY for android
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishmack committed Dec 20, 2024
1 parent ea25d0b commit 08efe5b
Show file tree
Hide file tree
Showing 2 changed files with 25 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 @@ -230,6 +230,7 @@ in {
++ onAndroid (fromUntil "9.0" "9.10" ./patches/ghc/ghc-9.6-hadrian-android.patch)
++ onAndroid (from "9.10" ./patches/ghc/ghc-9.10-hadrian-android.patch)
++ onAndroid (fromUntil "9.10" "9.11" ./patches/ghc/ghc-9.10-relax-llvm-max-version.patch)
++ onAndroid (from "9.12" ./patches/ghc/ghc-define-undefined-elf-st-visibility.patch)
++ onMusl (onAarch64 (fromUntil "9.4" "9.8" ./patches/ghc/ghc-9.6-hadrian-strip-cmd.patch))
++ onMusl (onAarch64 (fromUntil "9.8" "9.10" ./patches/ghc/ghc-9.8-hadrian-strip-cmd.patch))
++ onMusl (onAarch64 (fromUntil "9.10" "9.12" ./patches/ghc/ghc-9.10-hadrian-strip-cmd.patch))
Expand Down
24 changes: 24 additions & 0 deletions overlays/patches/ghc/ghc-define-undefined-elf-st-visibility.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/rts/linker/ElfTypes.h b/rts/linker/ElfTypes.h
index f5e2f819d9..7f75087738 100644
--- a/rts/linker/ElfTypes.h
+++ b/rts/linker/ElfTypes.h
@@ -33,6 +33,9 @@
#define Elf_Sym Elf64_Sym
#define Elf_Rel Elf64_Rel
#define Elf_Rela Elf64_Rela
+#if !defined(ELF64_ST_VISIBILITY)
+#define ELF64_ST_VISIBILITY(o) ((o)&0x3)
+#endif
#if !defined(ELF_ST_VISIBILITY)
#define ELF_ST_VISIBILITY ELF64_ST_VISIBILITY
#endif
@@ -60,6 +63,9 @@
#define Elf_Sym Elf32_Sym
#define Elf_Rel Elf32_Rel
#define Elf_Rela Elf32_Rela
+#if !defined(ELF32_ST_VISIBILITY)
+#define ELF32_ST_VISIBILITY(o) ((o)&0x3)
+#endif
#if !defined(ELF_ST_VISIBILITY)
#define ELF_ST_VISIBILITY ELF32_ST_VISIBILITY
#endif /* ELF_ST_VISIBILITY */

0 comments on commit 08efe5b

Please sign in to comment.