Files
simplex-chat/scripts/nix/android-iserv-static-libc.patch
T
Moritz Angermann 748becda3e Enable ARM32 Android Template Haskell on emulated Linux builders
Scope the scheduling opt-out to the patched QEMU versions, patch the interpreter source before planning, and expose the real static Bionic and GNU iconv symbols. Use the RTS package dependency for Android libffi.

The production interpreter reaches Haskell main on Rosetta and native ARM64 QEMU. Normal target TH, the ARM32 shared export, a C caller returning 42, and upstream annotations pass. Profiling execution is not yet validated.
2026-10-16 13:22:52 +09:00

42 lines
1.8 KiB
Diff

--- a/cbits/symbols.armv7a-android.c
+++ b/cbits/symbols.armv7a-android.c
@@ -353,34 +353,10 @@
MISSING_FUN(__loader_add_thread_local_dtor)
MISSING_FUN(__loader_remove_thread_local_dtor)
MISSING_FUN(__clang_call_terminate)
-// Symbols absent from the armv7a Android NDK's bionic / libc++ as
-// shipped with our current toolchain. The dynamic linker would
-// otherwise fail to load this library when it sees the unresolved
-// references via `SYM(...)` below. These stubs are never expected
-// to be invoked at runtime; if a real call ever lands here we
-// `exit(1)` with a diagnostic so the caller is visible instead of
-// silently corrupting state.
-MISSING_FUN(__arm_fadvise64_64)
-MISSING_FUN(__cxa_guard_abort)
-MISSING_FUN(__cxa_guard_acquire)
-MISSING_FUN(__cxa_guard_release)
-MISSING_FUN(__cxa_thread_finalize)
-MISSING_FUN(__fsetxattr)
-MISSING_FUN(__libc_stdio_cleanup)
-MISSING_FUN(_Z21__libc_shared_globalsv)
-MISSING_FUN(getentropy)
-MISSING_FUN(posix_spawn_file_actions_addchdir_np)
-MISSING_FUN(posix_spawn_file_actions_addclose)
-MISSING_FUN(posix_spawn_file_actions_adddup2)
-MISSING_FUN(posix_spawn_file_actions_addopen)
-MISSING_FUN(posix_spawn_file_actions_destroy)
-MISSING_FUN(posix_spawn_file_actions_init)
-MISSING_FUN(posix_spawnattr_destroy)
-MISSING_FUN(posix_spawnattr_init)
-MISSING_FUN(posix_spawnattr_setflags)
-MISSING_FUN(posix_spawnattr_setsigdefault)
-MISSING_FUN(posix_spawnp)
-MISSING_FUN(statx)
+// Bionic defines these functions in its static libc.a, including private
+// startup routines absent from the API-specific shared libc.so stubs. Keep
+// the extern/SYM references below so GHCi uses the same real libc state;
+// defining MISSING_FUN replacements here would shadow those implementations.
typedef void SymbolAddr;
typedef char SymbolName;