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

Allow linking against libSystem on macOS for testing of Mach-O executables #6155

Merged
merged 3 commits into from Aug 24, 2020

Conversation

@kubkon
Copy link
Member

@kubkon kubkon commented Aug 24, 2020

Ultimately, this will be up to the user to specify they want to link against libSystem on macOS when generating executables/dynamic libraries; however, since we don't propagate -l flags from main yet, baking in linkage to libSystem in Mach-O is currently behind a Mach-O property that can be enabled for all generated executables. As far as I can tell, since approximately Mountain Lion, every executable running on macOS is required to link against libSystem. Here's a link to discussion about this in LLVM.

kubkon added 2 commits Aug 21, 2020
This is required since an exec on macOS always has to link against
libSystem.dylib.

Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
This is required when generating an exe on macOS.

Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
@kubkon kubkon force-pushed the kubkon:macho-basic branch 3 times, most recently from 139beff to a85ba9e Aug 24, 2020
Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
@kubkon kubkon force-pushed the kubkon:macho-basic branch from a85ba9e to 39d104b Aug 24, 2020
@kubkon kubkon merged commit 9745e7b into ziglang:master Aug 24, 2020
3 checks passed
3 checks passed
builds.sr.ht: freebsd.yml builds.sr.ht job completed successfully
Details
continuous-integration/drone/pr Build is passing
Details
ziglang.zig #20200824.11 succeeded
Details
@kubkon kubkon deleted the kubkon:macho-basic branch Aug 24, 2020
@andrewrk
Copy link
Member

@andrewrk andrewrk commented Aug 24, 2020

Status quo in stage1 is that we always link dynamically against libSystem when targeting macOS, no exceptions. This has been working well, and I don't see a reason to make it optional. Hopefully that can simplify your task here

@kubkon
Copy link
Member Author

@kubkon kubkon commented Aug 24, 2020

Status quo in stage1 is that we always link dynamically against libSystem when targeting macOS, no exceptions. This has been working well, and I don't see a reason to make it optional. Hopefully that can simplify your task here

Awesome, thanks @andrewrk! It's not a biggie ATM, but it's definitely good to know, so thanks for the heads up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.