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

Make compiler inject appropriate -target option when linking Mach-O binaries #4589

Merged
merged 1 commit into from
Mar 24, 2024

Conversation

kinke
Copy link
Member

@kinke kinke commented Mar 1, 2024

No description provided.

@JohanEngelen
Copy link
Member

I'm going on vacation for a week, so can't test this until after 10 March.

This change is a little risky I have noticed, because the linker spits out a warning when it gets both -arch ... and -triple ... (which did happen for something similar to this change when working on #4431). Not nice to always see a warning when you compile a D program.

@kinke
Copy link
Member Author

kinke commented Mar 1, 2024

Don't worry, this is v1.38 stuff. :) - But I think it makes sense, more flexible this way (I hated having to hardcode iOS 12.0 in the config...).

@kinke
Copy link
Member Author

kinke commented Mar 21, 2024

Ping @JohanEngelen. Note that the universal package used to specify a (hardcoded) -target before #4553 (so before v1.37).

@JohanEngelen
Copy link
Member

I downloaded the universal build artifact and tested building LDC, and it failed when linking because again the -target is not detected correctly (I knew this was going to happen for when -target is at the end of link flags...):

-- Host D compiler linker flags: -L/Users/johan/ldc/test_gha/ldc2-746fb353-osx-universal/bin/../lib-arm64;-lphobos2-ldc;-ldruntime-ldc;-Wl,-dead_strip;-lpthread;-lm;-target;arm64-apple-macos14

this results in -larm64-apple-macos14 flag.

I fixed that issue here: #4603

With that change, building LDC works without issues.

@JohanEngelen
Copy link
Member

LGTM.

(the user can always override this triple with -mtriple=)

@kinke kinke merged commit 3a6f2ca into ldc-developers:master Mar 24, 2024
22 checks passed
@kinke kinke deleted the link_target_apple branch March 24, 2024 23:25
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 this pull request may close these issues.

2 participants