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

[5.7.0][Driver] Work around lld 13+ issue with --gc-sections for ELF by adding -z nostart-stop-gc (#60544) #60740

Closed
wants to merge 1 commit into from

Conversation

finagolfin
Copy link
Member

Cherrypick of #60653, the equivalent was already merged into 5.7 with swiftlang/swift-driver#1158 so best to get this into the C++ Driver in 5.7.0 too to avoid any inconsistency

Explanation: lld 13 changed how --gc-sections works last year, which was then flipped on by default, and causes all Swift code on ELF platforms not to link with lld 13 and 14 anymore if stripping is enabled.

Scope: Only affects lld for these ELF platforms

SR Issue: #60406

Risk: low, since it only affects ELF platforms for this one linker and flag

Testing: I built the last August 2 source snapshot of the 5.7 toolchain for Android AArch64, where lld 14 is the default linker, with this patch and it works well.

Reviewer: @compnerd

@finagolfin finagolfin requested a review from a team as a code owner August 24, 2022 06:41
@finagolfin
Copy link
Member Author

@DougGregor, let me know if we can get this in.

@al45tair, would you run the CI on this?

@keith
Copy link
Member

keith commented Aug 26, 2022

@swift-ci please test

Copy link
Contributor

@nkcsgexi nkcsgexi left a comment

Choose a reason for hiding this comment

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

This should affect non-Darwin platforms and the legacy driver only.

@finagolfin
Copy link
Member Author

Ping @DougGregor or @shahmishal, is it still possible to get this into the release/5.7.0 branch? Since this was already merged into the release/5.7 branch for swift-driver, swiftlang/swift-driver#1158, I believe this flag will be applied by the new swift-driver in the upcoming 5.7.0 release, so this pull is just to make sure the legacy C++ driver in the 5.7.0 compiler matches.

@finagolfin
Copy link
Member Author

Now that 5.7 is out, too late to get this in so closing.

@finagolfin finagolfin closed this Sep 12, 2022
@finagolfin finagolfin deleted the lld branch September 21, 2022 19:18
@AnthonyLatsis AnthonyLatsis added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.7 labels Jan 9, 2023
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.7
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants