Skip to content

Define jl_get_pgcstack_resolved in the native test loader. - #916

Merged
maleadt merged 1 commit into
mainfrom
tb/nightly
Aug 27, 2026
Merged

Define jl_get_pgcstack_resolved in the native test loader.#916
maleadt merged 1 commit into
mainfrom
tb/nightly

Conversation

@maleadt

@maleadt maleadt commented Aug 27, 2026

Copy link
Copy Markdown
Member

Since JuliaLang/julia#61527, Julia's LowerPTLS pass no longer bakes the address of the TLS getter into generated code on platforms without a static TLS offset (macOS, Windows), but emits a call to an external jl_get_pgcstack_resolved that Julia's own JIT defines through add_named_global. That symbol is not exported from libjulia, so the process-symbol generator used by Native.load cannot resolve it, and loading Julia-runtime-backed code (the runtime-backed boxed constants test added in #913) fails with Symbols not found.

Mirror what Julia's JIT does: look up the getter with jl_pgcstack_getkey and define it as an absolute symbol in the JITDylib.

Since JuliaLang/julia#61527, Julia's LowerPTLS pass no longer bakes the
address of the TLS getter into generated code on platforms without a
static TLS offset (macOS, Windows), but emits a call to an external
`jl_get_pgcstack_resolved` that Julia's own JIT defines through
`add_named_global`. That symbol is not exported from libjulia, so the
process-symbol generator used by `Native.load` cannot resolve it, and
loading Julia-runtime-backed code (the `runtime-backed boxed constants`
test added in #913) fails with `Symbols not found`.

Mirror what Julia's JIT does: look up the getter with
`jl_pgcstack_getkey` and define it as an absolute symbol in the JITDylib.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@maleadt
maleadt merged commit 6914611 into main Aug 27, 2026
36 of 61 checks passed
@maleadt
maleadt deleted the tb/nightly branch August 27, 2026 18:01
@maleadt maleadt mentioned this pull request Aug 27, 2026
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.56%. Comparing base (b171304) to head (8e3331f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #916   +/-   ##
=======================================
  Coverage   84.56%   84.56%           
=======================================
  Files          29       29           
  Lines        5546     5546           
=======================================
  Hits         4690     4690           
  Misses        856      856           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant