darwin: Allow posix_spawn_file_actions_addchdir to be missing when linking against process#377
Merged
Merged
Conversation
…nking against process In 0699e41 we attempted to account for darwin toolchains missing this symbol, which is imported as a weak references. However, weak references on MachO objects don't work the same way as on ELF (see iains/gcc-darwin-arm64#133). A final link with undefined weak references still fails. To fix this, on darwin, we explicilty add `-Wl,-U,_posix_spawn_file_actions_addchdir` to `ld-options` so anything linking against process explicilty instructs the linker to ignore undefined references to this symbol (set it to NULL at runtime). Fixes #376
e7f0437 to
6c70b60
Compare
Member
|
@MangoIV, can you comment on this? |
Contributor
Author
|
This should supersede #375, but we will validate this against GHC CI and get back to you. |
Contributor
|
I think this is a good fix. Since my solution doesn’t seem to work on its own, either, I think this is good. I wonder whether we should do both, though. Probably not right now though since this is the minimal fix |
Member
|
OK, and this is urgent due to impending GHC release, right? |
Contributor
|
yes, this is blocking the upcoming GHC releases. |
tomjaguarpaw
approved these changes
Jun 11, 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.
In 0699e41 we attempted to account for darwin toolchains missing this symbol, which is imported as a weak references.
However, weak references on MachO objects don't work the same way as on ELF (see iains/gcc-darwin-arm64#133). A final link with undefined weak references still fails.
To fix this, on darwin, we explicilty add
-Wl,-U,_posix_spawn_file_actions_addchdirtold-optionsso anything linking against process explicilty instructs the linker to ignore undefined references to this symbol (set it to NULL at runtime).Fixes #376