Skip to content

[5.7][cmake] Prevent test failures by disabling LTO for swift runtime #59631

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 1 commit into from
Jun 24, 2022

Conversation

thevinster
Copy link
Contributor

@thevinster thevinster commented Jun 22, 2022

We build a unified LLVM build with Swift and when enabling LTO, swift validation test suite fails for several ELF tests. The swift compiler defaults to the gold linker in these tests and fails to recognize bitcode files as inputs. This is also known issue for gold LTO as documented here (https://github.com/apple/swift/blob/main/lib/Driver/UnixToolChains.cpp#L166-L168). To prevent such test failures, prevent certain libraries, swiftrt and swiftDemangling from compiling with LTO when targeting Linux.

This change should should not affect anyone who don't build w/ LTO, and is a bug fix for those who try to build w/ LTO that targets Linux. This change was tested locally.

(cherry picked from #59425 commit a81bb11)

@thevinster thevinster marked this pull request as ready for review June 22, 2022 04:32
@thevinster thevinster requested a review from a team as a code owner June 22, 2022 04:32
@al45tair
Copy link
Contributor

@swift-ci Please smoke test

@al45tair
Copy link
Contributor

al45tair commented Jun 22, 2022

This only affects Linux, where it fixes some linker issues when using the gold linker, which is the default. It's pretty low risk IMO.

@al45tair
Copy link
Contributor

@swift-ci Please test

@drodriguez
Copy link
Contributor

@swift-ci please test

@drodriguez
Copy link
Contributor

@swift-ci please test macOS platform

@thevinster
Copy link
Contributor Author

@airspeedswift The checks have all succeeded. Could you help me merge this in?

@tbkka tbkka merged commit 8305829 into swiftlang:release/5.7 Jun 24, 2022
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.

5 participants