Swift 5.9 doesn’t work on Amazon Linux 2023 because of missing ld.gold?

swift 5.9 doesn’t work on Amazon Linux 2023, due to missing ld.gold:

error: link command failed with exit code 1 (use -v to see invocation)
clang-13: error: invalid linker name in argument '-fuse-ld=gold'

there is no way to obtain ld.gold from binutils on AL2023 due to an intentional decision by Amazon to drop support for ld.gold in favor of lld.

how do we use swift on Amazon Linux 2023?

Would passing -Xswiftc -use-ld=lld to swift build and swift test work in your case?

1 Like

Max's workaround should work for now, and you or whoever adds support for that distro can change the default linker to lld in the source.

1 Like