Skip to content

[6.0] Pass -lld-allow-duplicate-weak for coverage on Windows #1657

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

hamishknight
Copy link
Contributor

6.0 cherry-pick of #1655

  • Explanation: Avoids a linker error when building with coverage enabled by using lld-link and passing -lld-allow-duplicate-weak
  • Scope: Affects linking on Windows
  • Issue: rdar://129337999
  • Risk: Low, the fix is fairly straightforward
  • Testing: Added tests to test suite
  • Reviewer: Saleem Abdulrasool

Profiling currently relies on the ability to emit duplicate weak
symbols across translation units and having the linker coalesce them.
Unfortunately `link.exe` does not support this, so require `lld-link`
and pass `-lld-allow-duplicate-weak` when `-profile-generate` is
passed. We ought to be able to remove this once coverage is changed
to not rely on duplicate weak symbols, rdar://131295678 is tracking
that.

rdar://129337999
@hamishknight hamishknight requested a review from bnbarham July 10, 2024 13:40
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight hamishknight merged commit 2b5add9 into swiftlang:release/6.0 Jul 11, 2024
3 checks passed
@hamishknight hamishknight deleted the windows-coverage-6.0 branch July 11, 2024 21:37
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