Skip to content

[build] Pass target argument to the linker if needed #31794

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

Merged
merged 2 commits into from
May 18, 2020

Conversation

edymtt
Copy link
Contributor

@edymtt edymtt commented May 14, 2020

Following #31125 and #31612, -target is not added automatically to
linker flags when that's needed (e.g. when building for Apple SDKs) --
mimic the logic used to add it for compiler flags.

Addresses rdar://63138761

Following swiftlang#31125 and swiftlang#31612, `-target` is not added automatically to
linker flags when that's needed (e.g. when building for Apple SDKs) --
mimic the logic used to add it for compiler flags.

Addresses rdar://63138761
@edymtt
Copy link
Contributor Author

edymtt commented May 14, 2020

@swift-ci please test

@edymtt edymtt changed the title build] Pass target argument to the linker if needed [build] Pass target argument to the linker if needed May 14, 2020
Copy link
Contributor

@drexin drexin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general the patch looks good, thanks @edymtt. Not merging yet, as I want to give @compnerd the opportunity to respond first.

@compnerd
Copy link
Member

@drexin there’s the thread on the variable/predicate that I’d like to see resolved first.

@edymtt
Copy link
Contributor Author

edymtt commented May 15, 2020

@swift-ci please test

@drexin
Copy link
Contributor

drexin commented May 15, 2020

@compnerd Exactly, that's why I was saying I'd like to wait for you to respond :)

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 8b3464d

@edymtt
Copy link
Contributor Author

edymtt commented May 15, 2020

@swift-ci please test Windows

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 8b3464d

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM

@edymtt edymtt merged commit 0c403fe into swiftlang:master May 18, 2020
@edymtt edymtt deleted the add_target_to_linker_args_when_needed branch May 18, 2020 15:15
edymtt added a commit that referenced this pull request Jul 1, 2020
As part of this refactor some code touched as part of #31794 to better fit into the work done in #32120 -- in detail

* `_add_host_variant_c_compile_link_flags` is now invoked by both add_swift_host_library and add_swift_host_library
* `_add_host_variant_c_compile_link_flags` now sets the target in linker arguments when building against Apple SDKs

Addresses rdar://64911978
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.

4 participants