Problem
Cross-compiling for armv7a fails with a segfault in dl_impl.c when QEMU arm tries to evaluate Template Haskell in persistent-sqlite (makeCompatibleKeyInstances).
The iserv-proxy-interpreter crashes during symbol table initialization:
dl_impl: init_symtab called
dl_impl: g_nsyms = 0x1e41e
dl_impl: g_strsz = 0x7fb433
dl_impl: g_symtab = 0x1024c
dl_impl: g_strtab = 0x2e6524
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
iserv-proxy: {handle: <socket: 18>}: GHCi.Message.remoteCall: end of file
The failing TH splice is in Database/Persist/Sqlite.hs:
Code: makeCompatibleKeyInstances
[t| forall b. Compatible b (RawSqlite b) |]
Reproduction
From prrrrrrrrr (or any consumer with persistent-sqlite as a cross-dep):
nix-build nix/android.nix --argstr androidArch armv7a
Analysis
dl_impl initializes its symbol table from the static iserv-proxy-interpreter binary's ELF headers
g_symtab = 0x1024c looks suspiciously low — possibly a file offset being used as a memory address, or the symbol table falls in an unmapped region under QEMU arm
- aarch64 builds work fine (CI passes), only armv7a is affected
- armv7a intentionally omits
-pie (because "ARM32 CRT startup doesn't reliably relocate .dynsym entries in static PIE") — this non-PIE setup may interact poorly with how dl_impl reads the symbol table
- prrrrrrrrr CI never builds armv7a (
apkArm7a is defined in ci.nix but not built), so this was never caught
Environment
🤖 Generated with Claude Code
Problem
Cross-compiling for armv7a fails with a segfault in
dl_impl.cwhen QEMU arm tries to evaluate Template Haskell inpersistent-sqlite(makeCompatibleKeyInstances).The iserv-proxy-interpreter crashes during symbol table initialization:
The failing TH splice is in
Database/Persist/Sqlite.hs:Reproduction
From prrrrrrrrr (or any consumer with persistent-sqlite as a cross-dep):
Analysis
dl_implinitializes its symbol table from the static iserv-proxy-interpreter binary's ELF headersg_symtab = 0x1024clooks suspiciously low — possibly a file offset being used as a memory address, or the symbol table falls in an unmapped region under QEMU arm-pie(because "ARM32 CRT startup doesn't reliably relocate .dynsym entries in static PIE") — this non-PIE setup may interact poorly with how dl_impl reads the symbol tableapkArm7ais defined in ci.nix but not built), so this was never caughtEnvironment
🤖 Generated with Claude Code