Repository navigation
0.23.5: a part of fork the library does not export is not called - #51
Merged
Merged
Conversation
This was referenced Nov 18, 2026
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.
The defect
kal_space_start(and a confined start) calls the parts of libSystem's ownforkby their names —_dyld_atfork_*,_malloc_fork_*,_libc_fork_*,_pthread_atfork_*,_mach_fork_child— as ordinary imports. A system built from the same sources whose library does not export every one of them refuses the whole program at load:Measured on PureDarwin 26.5 (xnu-12377, x86_64) with a program of
x86_64-macos-musl.The change
The thirteen names are weak imports, and each is called when it is bound. On macOS all of them are bound and the calls are the ones made before. A part that is absent is not called: the state it would have prepared belongs to a part the program cannot reach either.
Measured
The same program, rebuilt against this branch, starts on PureDarwin 26.5 and runs a batch script that makes, copies, renames, lists and removes files, with the output it gives on Linux.
llvm-nm -mshows the thirteen names asweak external … (from libSystem).