Emit native test objects with the JIT target machine - #929
Merged
Merged
Conversation
The native test helper only used JITTargetMachine for :patch and :table
jobs; :bake objects went through the stock target machine (small code
model, static relocations). Their 32-bit references to constant pools
cannot reach the addresses ORC loads code at, so JITLink rejects the object
("out of range of Pointer32Signed fixup") or, on older LLVM without the
range check, the worker segfaults. On Windows the stock machine also emits
COFF where the ORC JIT is configured for ELF, yielding garbage results and
a crash in LLVMOrcDisposeLLJIT. Only macOS, where Mach-O is inherently
position independent, was unaffected.
Every :obj request now goes through JITTargetMachine, whose JITDefault code
model is large on x86-64 and whose Windows triple is *-elf. Assembly output
is unchanged.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #929 +/- ##
=======================================
Coverage 85.76% 85.76%
=======================================
Files 29 29
Lines 5597 5597
=======================================
Hits 4800 4800
Misses 797 797 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Test-infrastructure fix split out of #926.
The native test helper's
mcgenoverride only usedJITTargetMachinefor:patchand:tablejobs;:bakeobjects fell through to the stock target machine, which uses the small code model with static relocations. Objects built that way only work when loaded below 2 GiB, which ORC does not guarantee:relocation target .rodata.cst32 ... is out of range of Pointer32Signed fixupas soon as the code has a constant pool.JITTargetMachineappends-elfto the triple), giving garbage return values and a later crash inLLVMOrcDisposeLLJIT.Every
:objrequest now goes throughJITTargetMachine, whoseJITDefaultcode model resolves to large on x86-64 and whose Windows triple is*-elf. Assembly output (what most native tests inspect) is unchanged.The existing
Native.loadusers all pass:patchor:tableand were already on this path; the first:bake+loadtests arrive with #926 (device-library providers and the softfloat native test, which has vector constants), so this needs to land before or with those.