Repository navigation
Fix compiler and RTS portability issues exposed by haskell.nix - #196
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The heap-view regression does not link Emscripten and fails independently of the export fix.
1 open finding
What changed in this PR
Backports targeted compiler and runtime portability fixes exposed by haskell.nix, with focused regression tests.
Changes:
- Restores profiling library suffixes and preserves x86 PIC jump-table trampolines.
- Fixes Android recognition, ELF/Windows linking, Emscripten heap exports, and wasm archive padding.
- Adds regression fixtures and targeted diagnostic normalization.
| File | Description |
|---|---|
| testsuite/tests/rts/linker/Makefile | Builds new linker regressions. |
| testsuite/tests/rts/linker/elf_visibility.py | Checks visibility macro fallbacks. |
| testsuite/tests/rts/linker/elf_local_got.stdout | Records expected success. |
| testsuite/tests/rts/linker/elf_local_got.s | Exercises local GOT references. |
| testsuite/tests/rts/linker/elf_local_got.hs | Loads and executes GOT fixture. |
| testsuite/tests/rts/linker/elf_got_symbols.c | Checks GOT symbol selection. |
| testsuite/tests/rts/linker/bfd_imports.stdout | Records expected success. |
| testsuite/tests/rts/linker/bfd_imports.hs | Exercises Windows import resolution. |
| testsuite/tests/rts/linker/bfd_imports.def | Declares fixture exports. |
| testsuite/tests/rts/linker/bfd_imports_library.c | Supplies imported functions and data. |
| testsuite/tests/rts/linker/bfd_imports_client.c | References fixture imports. |
| testsuite/tests/rts/linker/bfd_imports_check.py | Checks BFD archive markers. |
| testsuite/tests/rts/linker/all.T | Registers linker regressions. |
| testsuite/tests/javascript/JSHeapViews.stdout | Records expected heap checks. |
| testsuite/tests/javascript/JSHeapViews.hs | Adds heap-view regression. |
| testsuite/tests/javascript/all.T | Registers heap-view test. |
| testsuite/tests/ghc-api/X86JumpTableShortcut.hs | Checks jump-table shortcut behavior. |
| testsuite/tests/ghc-api/UnitHsLibs.hs | Checks library naming across ways. |
| testsuite/tests/ghc-api/all.T | Registers compiler API regressions. |
| testsuite/tests/driver/WasmArchivePadding.stdout | Records expected success. |
| testsuite/tests/driver/WasmArchivePadding.hs | Checks archive padding and malformed lengths. |
| testsuite/tests/driver/Makefile | Runs Android conversion probe. |
| testsuite/tests/driver/android_target_os.py | Exercises OS conversion through autoconf. |
| testsuite/tests/driver/all.T | Registers driver regressions. |
| testsuite/tests/codeGen/should_gen_asm/pic-jump-table.cmm | Supplies PIC switch fixture. |
| testsuite/tests/codeGen/should_gen_asm/pic-jump-table.asm | Checks relative tables and trampolines. |
| testsuite/tests/codeGen/should_gen_asm/pic-jump-table-split.cmm | Reuses fixture for split sections. |
| testsuite/tests/codeGen/should_gen_asm/pic-jump-table-split.asm | Checks split-section assembly. |
| testsuite/tests/codeGen/should_gen_asm/all.T | Registers PIC assembly regressions. |
| testsuite/driver/testlib.py | Normalizes specific older Emscripten warnings. |
| rts/rts.cabal | Extends vector ISA flags to i386. |
| rts/linker/PEi386.c | Preserves imported symbol types. |
| rts/linker/ElfTypes.h | Supplies missing visibility macros. |
| rts/linker/elf_got.c | Includes supported named-local GOT definitions. |
| rts/js/mem.js | Exports Emscripten byte heap views. |
| m4/ghc_convert_os.m4 | Accepts bare Android OS components. |
| compiler/GHC/Unit/Info.hs | Restores profiling library suffixes. |
| compiler/GHC/SysTools/Ar.hs | Trims wasm BSD archive padding safely. |
| compiler/GHC/CmmToAsm/X86/Instr.hs | Keeps relative jump-table targets local. |
| compiler/GHC/CmmToAsm.hs | Retains PIC trampolines and CFG nodes. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
angerman
added a commit
that referenced
this pull request
Oct 15, 2026
Reuse the Windows time/bootstrap and make-host fixes, FreeBSD Sphinx port selection, and archived Debian 11 repositories already carried by #196. These unblock release jobs before they reach compiler validation.
This was referenced Oct 15, 2026
angerman
force-pushed
the
fix/haskell-nix-portability
branch
from
October 15, 2026 11:50
9e5d829 to
170619c
Compare
angerman
marked this pull request as ready for review
October 15, 2026 13:02
angerman
force-pushed
the
fix/haskell-nix-portability
branch
from
October 15, 2026 23:38
170619c to
5fa0da6
Compare
Restore profiling library suffixes, export the Emscripten heap views, and apply vector ISA flags consistently on both x86 widths. Keep PIC jump-table shortcuts within their procedure and preserve the required trampolines. Handle Android target names, ELF visibility fallbacks and supported local GOT definitions. Preserve BFD import types and nullable lookup outputs. Trim Apple ranlib padding from wasm archive members with bounded decoding. Add focused regressions, including assembler-independent local GOT and GNU BFD fixtures. Repair Windows, FreeBSD, Debian and macOS CI prerequisites, provide pinned native Alex/Happy for stage3, and wire Make test capabilities. Qualify the BFD regression archive path to locate its adjacent DLL. Filter only complete Apple ranlib warnings about empty archive members, preserving other diagnostics and exit failures without Apple-only command-line flags. Handle PATH launchers whose diagnostics name a resolved absolute ranlib path, and cover both qualified and PATH invocations in the regression.
angerman
force-pushed
the
fix/haskell-nix-portability
branch
from
October 16, 2026 11:46
db223fb to
0aae70d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Profiling links can select vanilla archives, x86 PIC jump-table shortcutting can produce invalid label differences, and several compiler/RTS paths fail with toolchains and object files used by haskell.nix. Extract the bounded fixes from
stable-ghc-9.14-hnand add focused regressions.Changes
The GOT fixture localizes its definitions after assembly so older assemblers retain named, zero-addend GOT references. The BFD fixture supplies an explicit archive directory to locate the adjacent DLL, requires GNU dlltool and verifies long-form archive members; tool discovery accepts GNU's qualified-path banners and reports rejected candidates.
Build and CI prerequisites
Rebuild Windows time against the pinned dependency graph; recognize Cygwin/MinGW make; select FreeBSD Sphinx by port origin; archive only Debian 11's retired security repository; build pinned native Alex/Happy for stage3; pin ARM macOS release jobs to macOS 15 and isolate their native Cabal cache by OS/bootstrap GHC. Package the authoritative inputs for installed-compiler tests and populate Make's NCG capability field, matching Hadrian.
Suppress only complete Apple ranlib diagnostics about valid empty archive members. Preserve other diagnostics, argument handling and failing exit statuses; avoid Apple-only flags rejected by LLVM ranlib. A native process regression covers qualified and PATH-based invocations, resolved absolute tool paths, neighboring/error diagnostics and exit failures, and runs in compiled normal mode.
The shared Wasm bootstrap now downloads the full official GitHub mirror at a pinned revision and verifies its SHA256 before running upstream setup. This avoids GitLab returning anti-bot HTML with HTTP 200, including the bootstrap script's nested GitLab archive request. Full
FLAVOUR=9.12setup and consumer coverage are preserved.Validation
Two focused commits on
93c3dc1716: portability corrections09f5c34611and the shared CI bootstrap repair0aae70d65d. #197 is stacked directly above them. CI has restarted on the corrected heads. Merge by fast-forward only after the current candidates are green../libbfd_imports.afixture passes every assertion: nullable lookup, first function/data relocation, shared storage update and cached lookup; stdout isOK, stderr is empty. The diagnostic workflow is red because it retains the failing control. This fixture correction does not claim to repair the loader's bare-path handling.ranlib, while Apple printed its resolved Xcode path. An actual cctools launcher reproduces the published filter's warning leak; the reviewed correction accepts only resolved absolute paths with the configured basename and complete known warning grammar. Independent POSIX/Windows path probes and the extended process regression pass.static001qualification is pending in current CI.170619c331, normal CI and Nix CI passed: four normal native suites, six Nix native suites, three MULTI cross builds and three artifact-consuming e2e jobs. The e2e jobs compile/run native, Wasm and JS hello programs and build the Miso Wasm example. ARM Linux JUnits explicitly confirm the actual RTSelf_local_gotregression; x86 JUnits confirm both PIC regressions. These results qualify the earlier source, not the new head.5fa0da603b/f2956276fe, both complete Windows runtime suites passed. The new Nix failures occurred during Wasm SDK bootstrap: Fix compiler and RTS portability issues exposed by haskell.nix #196 explicitly logged an Anubis HTML page, while Cmm: declare CPU requirements on RTS procedures #197's Linux consumers failed parsing the same URL before downloading compiler artifacts. The pinned-mirror repair passes HTML/corruption/failure/cleanup probes and a real Darwin SDK/libffi compile/link check. Complete setup and consumers remain current CI gates.The previous Debian ARM suite stopped before tests on a transient archived-package HTTP 404; its exact package later matched the authenticated archive index and installed successfully in #197. A targeted retry is running. The new-head CI must independently pass.
The RWX pool, unconditional libc.a skip, PREL31-as-REL32 change, CRT-specific exports, OS-hardcoded C++ runtime choice and ABI-hash cleanup remain excluded.