Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macho: fix linking of dylibs and frameworks #9542

Merged
merged 1 commit into from
Aug 10, 2021
Merged

Conversation

kubkon
Copy link
Member

@kubkon kubkon commented Aug 9, 2021

Previously, I have incorrectly assumed that with two-level namespace
we only need to link in dylibs/frameworks that actually export symbols
which are undefined in the linked image. Turns out, regardless of
whether we link with two-level namespace (default on macOS) or a
flat namespace (more common on other platforms), we always need to
put the dylibs/frameworks as specified by the user from the linker
line into the final linked image.

cc @floooh this should fix the issue you reported on twitter.

Previously, I have incorrectly assumed that with two-level namespace
we only need to link in dylibs/frameworks that actually export symbols
which are undefined in the linked image. Turns out, regardless of
whether we link with two-level namespace (default on macOS) or a
flat namespace (more common on other platforms), we always need to
put the dylibs/frameworks as specified by the user from the linker
line into the final linked image.
@kubkon kubkon merged commit f2bf139 into master Aug 10, 2021
@kubkon kubkon deleted the fix-link-frameworks branch August 10, 2021 06:13
@floooh
Copy link
Contributor

floooh commented Aug 10, 2021

Here's the twitter thread for reference: https://twitter.com/FlohOfWoe/status/1424419698628833284

Also: the fix is working :)

motiejus added a commit to motiejus/zig that referenced this pull request Dec 11, 2021
If `-framework` is requested, but not found, the linker will err
instead of creating a strange executable.

ziglang#10299 (comment)

Refs ziglang#9542
Refs ziglang#10299
Refs ziglang#10158
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants