Skip to content

[🍒 swift 6.0.x] Default Linux toolchain linker to gold #77381

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

Conversation

etcwilde
Copy link
Member

@etcwilde etcwilde commented Nov 5, 2024

The BFD linker on most of the Linux box is unable to link Swift objects. Currently the Swift driver hard-codes forcing the default linker to gold, but we want to support configuring this, so we need build-script to force it at the clang level instead.

Cherry-Picks:
d63152f
7596d00
8262552

Was originally #77209.
The PR that was merged instead missed a few changes, so this pulls all of them across, working around the mishandled relocation by bfd:

/usr/bin/ld: src/swift/CMakeFiles/swiftDispatch.dir/Block.swift.o: relocation R_X86_64_PC32 against protected symbol `$s8Dispatch0A13WorkItemFlagsVSYAAMc' can not be used when making a shared object

The BFD linker on most of the Linux box is unable to link Swift objects.
Currently the Swift driver hard-codes forcing the default linker to
gold, but we want to support configuring this, so we need build-script
to force it at the clang level instead.

Cherry-Picks:
  d63152f
  7596d00
  8262552
@etcwilde etcwilde requested a review from a team as a code owner November 5, 2024 01:56
@etcwilde etcwilde changed the title Default Linux toolchain linker to gold [🍒 swift 6.0.x] Default Linux toolchain linker to gold Nov 5, 2024
@etcwilde
Copy link
Member Author

etcwilde commented Nov 5, 2024

@swift-ci please test

@etcwilde etcwilde merged commit 7616da0 into swiftlang:release/6.0 Nov 5, 2024
5 checks passed
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