Call jl_init_options from jl_autoinit_and_adopt_thread - #62883
Draft
gbaraldi wants to merge 2 commits into
Draft
Conversation
`jl_init_options` is normally invoked by the libjulia loader (cli/loader_lib.c) before anything else runs. When the runtime is linked statically into an image there is no loader, and the auto-initialization trampoline is the first runtime entry point, so make it initialize `jl_options` itself. `jl_init_options` is idempotent, so this is a no-op for the shared build. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
It only initializes the jl_options struct (plus getenv/strtol), and is now called from the JL_NOTSAFEPOINT path of jl_autoinit_and_adopt_thread, which the GC analyzer rejects without the annotation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
jl_init_optionsis normally called by the libjulia loader (cli/loader_lib.c) before any other runtime code. In a static build of libjulia-internal (#62868) there is no loader, andjl_autoinit_and_adopt_thread— the trampoline that images call on first entry — becomes the first runtime entry point, sojl_optionswould never be initialized. Calljl_init_optionsthere beforejl_init_with_image_handle.jl_init_optionsguards itself withjl_options_initialized, so this is a no-op for the regular shared build.Part of the static libjulia-internal work.
🤖 Generated with Claude Code