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

Alternative to copying part of a recent Xcode libSystem.tbd to src/mach_dyld_atfork.tbd #49976

Closed
benz0li opened this issue May 28, 2023 · 4 comments · Fixed by #50017
Closed

Comments

@benz0li
Copy link
Contributor

benz0li commented May 28, 2023

I find copying part of a recent Xcode libSystem.tbd file into the Julia source code rather odd.

It also prevents MacPorts from building current Julia versions (≥ 1.8.0) on 'OS X'/macOS 10.10 - 10.14 (Yosemite - Mojave).


@quentinmit was able to get Julia to build on macOS 10.14 (Mojave)

[...] with a simple Makefile patch; I replaced

OSLIBS += $(SRCDIR)/mach_dyld_atfork.tbd

with

CLANG_LDFLAGS += -Wl,-U,__dyld_atfork_prepare -Wl,-U,__dyld_atfork_parent

and added $(CLANG_LDFLAGS) to the rules building libjulia-internal and libjulia-internal-debug. The latter is probably safe on every platform but the former needs a guard for older OS versions, of course.

It's possible that the additional -U flags are unnecessary, but I didn't test that (the previous line sets a different flag that theoretically should allow unknown symbols as well).

#65550 (julia: link fails for 10.14 and earlier: ld: unsupported tapi file type '!tapi-tbd' in YAML file) – MacPorts


Cross references:

@benz0li
Copy link
Contributor Author

benz0li commented May 28, 2023

@quentinmit Could you please provide a full diff of your changes [that got Julia to build on macOS 10.14 (Mojave)] so @vtjnash may look into those?

I myself am not familiar enough with Xcode and Clang to help any further. Adding/Modifying a Clang command line argument instead of file src/mach_dyld_atfork.tbd makes more sense to me, though.

benz0li added a commit to benz0li/julia that referenced this issue May 31, 2023
- Remove file src/mach_dyld_atfork.tbd
- Fixes JuliaLang#49976
@quentinmit
Copy link

Unfortunately, I can't for the life of me find the patched source tree I used to build my julia :(

It looks like MacPorts has more or less applied my diff here, though: macports/macports-ports@56bf1a4#diff-ca423e7f15760e3e098d84955b5b68cc727d53538b6d50aa95d6a1fee7f49818

Basically, it's just telling the linker that it's okay if __dyld_atfork_prepare and __dyld_atfork_parent are undefined.

@vtjnash
Copy link
Member

vtjnash commented Jun 27, 2023

I reviewed it at #50017. Currently that is breaking for most platforms, but if you remove the unnecessary Makefile changes and just add the -Wl,-U, we can merge that.

@benz0li
Copy link
Contributor Author

benz0li commented Jun 28, 2023

@vtjnash Thank you for looking into this and for your feedback.

Very much appreciated.

vtjnash pushed a commit that referenced this issue Jun 29, 2023
Replace file src/mach_dyld_atfork.tbd with command line flags

Fixes #49976
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants