Skip to content

[6.0] [LLD] [COFF] Add a separate option for allowing duplicate weak symbols #8959

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
Jul 9, 2024

Conversation

hamishknight
Copy link

6.0 cherry-pick of #8944

  • Explanation: Adds an lld-link flag for enabling duplicate weak symbol support
  • Scope: Affects lld-link option parsing
  • Issue: rdar://129337999
  • Risk: Low
  • Testing: Tested locally
  • Reviewer: Ben Barham, Saleem Abdulrasool

llvm#68077)

The MinGW mode (enabled with the flag -lldmingw) does allow duplicate
weak symbols. A test in
compiler-rt/test/profile/Windows/coverage-weak-lld.cpp does currently
enable the -lldmingw flag in an MSVC context, in order to deal with
duplicate weak symbols.

Add a new, separate, lld specific flag for enabling this. In MinGW mode,
this is enabled by default, otherwise it is disabled.

This allows making the MinGW mode more restrictive in adding libpaths
from the surrounding environment; in MinGW mode, all libpaths are passed
explicitly by the compiler driver to the linker, which is attempted in
https://reviews.llvm.org/D144084.
@hamishknight hamishknight requested a review from bnbarham July 9, 2024 12:11
@hamishknight
Copy link
Author

@swift-ci please test

@bnbarham bnbarham merged commit ffe3bf3 into swiftlang:swift/release/6.0 Jul 9, 2024
3 checks passed
@hamishknight hamishknight deleted the dup-weak-6.0 branch July 9, 2024 20:14
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.

3 participants