staticdata: load the statically linked sysimage without dlsym #62884
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 340 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.349
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #62884"
general
weight: 0.35
xal-0
Follow-up to #62868. When libjulia-internal is built as a static library (
JL_LIBRARY_STATIC, see #62868) the system image is linked into the same binary, so its symbols can be resolved by the static linker instead of being looked up through the dynamic linker.Previously the static build still
dlopened the sysimage path given on the command line (or the default../lib/julia/sys.so) before consulting the linked image, so a static executable could not start without asys.soon disk, andjl_options.image_filekept naming that file.Changes:
jl_image_pointers,jl_system_image_checksum,jl_system_image_data,jl_system_image_size) are referenced through aJL_IMAGE_SYMmacro. The static build resolves them directly against the linked-in sysimage, ignoring the handle entirely; the shared build resolves them throughjl_dlsymexactly as before.jl_preload_sysimg/jl_set_sysimg_soshort-circuit to the linked image in the static build and record the binary containing it asjl_options.image_file(soBase.julia_cmd()sees a real file). Any-Jon the command line is ignored. Package images cannot be loaded into a statically linked libjulia-internal, so the static build asserts!is_pkgimageinget_image_buf; the shared build's pkgimage path, including the libjulia-internal consistency check, is unchanged.image.basecomputation is factored intojl_image_base, which takes the address of the image'sjl_image_pointers(the static path has no handle). It still usesdli_fbase(and the module handle on Windows) as before. Note that for a non-PIE main executabledli_fbasediffers from the link-mapl_addrthat debuginfo.cpp keys on; the JIT is not expected to work with a static libjulia-internal, so this is left alone.null_sysimage.cis removed: the shared build no longer referencesjl_image_unpack, and its declaration in processor.h is now guarded byJL_LIBRARY_STATIC.Tested: full build + stdlib precompile (exercises the pkgimage dlsym path), the
precompiletest suite, andmake -C src usr/lib/libjulia-internal.a(nothing underJL_LIBRARY_STATICis built by the default targets or CI).nmshowsstaticdata.static.owithUreferences to the five image symbols and nojl_image_unpackdefinition in the archive or inlibjulia-internal.so.Split images (
--output-o+--output-ji) are only produced for package images, which are always dlopened, so linking one into a static binary is not supported; the static archive's direct references tojl_system_image_data/jl_system_image_sizemake that fail at link time.This pull request was written with the assistance of generative AI (Claude Code).