[Bug] - ld.gold is missing from binutils package
Describe the bug
On ALI2 (and Ubuntu) the linker ld.gold is included in the binutils package
binutils-2.29.1-31.amzn2.x86_64 : A GNU collection of binary utilities
Repo : @amzn2-core
Matched from:
Filename : /usr/bin/ld.gold
The linker is missing from binutils package on ALi2023.
$ dnf whatprovides ld.gold
Last metadata expiration check: 0:08:18 ago on Mon Apr 24 12:12:49 2023.
Error: No matches found. If searching for a file, try specifying the full path or using a wildcard prefix ("*/") at the beginning.
$ dnf repoquery -l binutils | grep gold
Last metadata expiration check: 0:08:42 ago on Mon Apr 24 12:12:49 2023.
This prevent to build some open source projects from the source (ex : https://swift.org)
To Reproduce To an instance with ALI2023 and type
dnf whatprovides ld.gold
Expected behavior
ld.gold is part of the standard toolchain for multiple open source projects. These projects can not be compiled on ALI2023
Screenshots n/a
Desktop (please complete the following information):
- ALI 2023
commit 8723c3add11eff25826b05275342b5df845ba31e (origin/al2022-new-macros)
Author: Amit Shah <[email protected]>
Date: Wed Jun 29 13:34:08 2022 +0000
binutils: drop gold
The gold linker has bitrotted, and does not see updates anymore.
The original devs of the gold linker have moved on to LLVM.
This drops the subpackage binutils-gold.
This is an intentional change, to not currently ship ld.gold.
Is the root request here to have the Swift compiler available on Amazon Linux 2023?
I am working with Apple on the scripts used to build the distribution packages of Swift on different platforms. We are adding support for Amazon Linux 2023. https://github.com/apple/swift-installer-scripts
The port from Amazon Linux 2 to Amazon Linux 2023 is made difficult by two breaking changes:
- the first one is the lack of support for
ld.goldforcing us to modify the build scripts to uselldon Amazon Linux 2023 only (other platforms Ubuntu, ALI2, RedHat, Oracle Linux, Debian all provideld.gold) - the second one is specific to Graviton : the clang tool chain is located under
/lib/gcc/aarch64-amazon-linux/11which is not found - by default - byclang. I wonder what drove the decision to use a custom name vs using a standard one likeaarch64-linux-gnu
Similar issue with Go, it currently requires the Gold linker for builds on ARM so the official binary releases are not compatible (https://github.com/golang/go/issues/22040).
It looks like this may be resolved in binutils 2.41 (https://github.com/golang/go/issues/22040#issuecomment-1678403929), however this is also newer than what Amazon Linux 2023 ships with.
Here is an easy script to install ld.gold from the sources on Amazon Linux 2023
https://gist.github.com/sebsto/219315a80333fb0661e03be2e0d00c80
to build pandoc you need ld.gold
The regular linker probably works fine (although I haven't tried it)
for some reason the haskel cabal builds in EPEL need the ld.gold linker to build.
¯\_(ツ)_/¯
https://www.phoronix.com/news/GNU-Gold-Linker-Deprecated The GNU Binutils 2.44 release announcement explained the current situation: "In a change to our previous practice, in this release the binutils-2.44.tar tarball does not contain the sources for the gold linker. This is because the gold linker is now deprecated and will eventually be removed unless volunteers step forward and offer to continue development and maintenance.
The gold sources can be found in the binutils-with-gold-2.44.tar tarballs. Going forward, odd numbered releases of the binutils (2.45, 2.47, etc) will just have the binutils.2.xx.tar tarballs, whilst even numbered releases will have both the binutils-2.xx.tar and the binutils-with-gold-2.xx.tar tarballs. Eventually this will stop and gold will be dropped altogether."
I'm going to tag this issue as documentation, as we should document the deprecation of ld.gold in the AL2023 User Guide.