-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Set toolchain clang linker to gold (Linux) #73463
Conversation
@swift-ci please test |
@swift-ci please test Linux toolchain |
apple/swift-driver#1596 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that is a long standing issue with BFD and our usage of protected symbols.
75f657d
to
ec74b91
Compare
apple/swift-driver#1608 |
apple/llvm-project#8748 |
apple/llvm-project#8748 |
1 similar comment
apple/llvm-project#8748 |
ec74b91
to
6098d98
Compare
apple/llvm-project#8748 |
IT'S FINALLY GREEN ON LINUX! 😆 |
apple/llvm-project#8748 |
apple/llvm-project#8748 |
apple/llvm-project#8748 |
The just-built Swift driver was picking up the system clang, which would try to use the bfd linker instead of gold or lld. bfd doesn't like how Swift handles protected symbols and fails with the following error: ``` error: link command failed with exit code 1 (use -v to see invocation) /usr/bin/ld: /home/build-user/build/buildbot_linux/libdispatch-linux-x86_64/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 /usr/bin/ld: final link failed: bad value ``` This patch tells the Swift-Driver where it should find its clang, and makes it match the clang that is in use through the rest of the build.
BFD doesn't work with Swift symbols. We get nasty errors like this: ``` error: link command failed with exit code 1 (use -v to see invocation) /usr/bin/ld: ...wift/CMakeFiles/swiftDispatch.dir/Block.swift.o: relocation R_X86_64_PC32 against protected symbol `$s8Dispatch0A13WorkItemFlagsVSYAAMc' can not be used when making a shared object /usr/bin/ld: final link failed: bad value ```
6098d98
to
d63152f
Compare
apple/llvm-project#8748 |
2 similar comments
apple/llvm-project#8748 |
apple/llvm-project#8748 |
apple/llvm-project#8748 |
apple/llvm-project#8748 |
BFD doesn't work with Swift symbols. We get nasty errors like this:
rdar://123061492