Skip to content

Comments

Introduce cross compilation example#1630

Open
bolt12 wants to merge 3 commits intomainfrom
bolt12/738
Open

Introduce cross compilation example#1630
bolt12 wants to merge 3 commits intomainfrom
bolt12/738

Conversation

@bolt12
Copy link
Collaborator

@bolt12 bolt12 commented Jan 29, 2026

This closes #738

@bolt12 bolt12 self-assigned this Jan 29, 2026
@bolt12 bolt12 force-pushed the bolt12/738 branch 3 times, most recently from 1b78be8 to 58d807b Compare February 17, 2026 11:10
@bolt12 bolt12 force-pushed the bolt12/738 branch 2 times, most recently from b79450c to ef31a5d Compare February 18, 2026 11:56
GHC's runtime linker only checks the Thumb bit (bit 0) for ELF symbols
with type STT_FUNC.  Imported symbols (e.g. glibc's strlen resolved via
dlsym) have type STT_NOTYPE, so the check is skipped.  This causes the
linker to emit ARM BL instead of BLX for ARM→Thumb calls, resulting in
SIGILL when Template Haskell evaluation triggers calls to Thumb glibc
functions under QEMU.

The patch adds a fallback that detects the Thumb bit from the resolved
address itself, which dlsym preserves on ARM32 Linux.

Also pin nixpkgs to nixos-25.05 (GHC 9.8.4) to avoid an LLVM ARM32
crash affecting GHC 9.10+ with all LLVM 17–21.

Add core dump files to .gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Experiment with and document the cross-compilation workflow

1 participant