Skip to content

[5.3] Properly compute resource folder when linking statically #33678

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

Conversation

drexin
Copy link
Contributor

@drexin drexin commented Aug 28, 2020

Cherry-pick of #33168 into release/5.3

This PR depends on the following PRs:

swiftlang/swift-corelibs-foundation#2863
swiftlang/swift-corelibs-foundation#2862
swiftlang/swift-corelibs-libdispatch#546

  • Explanation: Prior to this patch the frontend always used the shared resource folder, which is different from the behavior of the driver and causes static linking to not function properly, as some modules need to link against additional libraries when linked statically.
  • Scope: This PR only affects platforms that allow static linking, e.g. Linux, but not Darwin based platforms. It fixes a long standing issue with static linking on said platforms.
  • Risk: Low
  • Testing: Existing test suite covers static linking for stdlib. Added test cases for -print-target-info.
  • Issue: rdar://problem/67948984
  • Reviewer: @DougGregor

@drexin drexin requested a review from DougGregor August 28, 2020 07:07
@drexin drexin requested a review from a team as a code owner August 28, 2020 07:07
@drexin
Copy link
Contributor Author

drexin commented Aug 28, 2020

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - bfb4ccc5799b31f4b48b1549c39a73b982d98664

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - bfb4ccc5799b31f4b48b1549c39a73b982d98664

- deduplicate the logic to compute the resource folder
- install headers and module files in shared and static resource folders
- forward -static flag when calling swiftc with -print-target-info
@drexin drexin force-pushed the wip-backport-static-linking-5.3 branch from bfb4ccc to e8fe229 Compare August 28, 2020 14:54
@drexin
Copy link
Contributor Author

drexin commented Aug 28, 2020

@swift-ci test

@drexin
Copy link
Contributor Author

drexin commented Aug 28, 2020

@swift-ci Please nominate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants