amazonlinux / amazon-linux-2023

Amazon Linux 2023
https://aws.amazon.com/linux/amazon-linux-2023/
Other
521 stars 39 forks source link

[Bug] - ld.gold is missing from binutils package #330

Open sebsto opened 1 year ago

sebsto commented 1 year ago

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):

sebsto commented 1 year ago
commit 8723c3add11eff25826b05275342b5df845ba31e (origin/al2022-new-macros)
Author: Amit Shah <aams@amzn.com>
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.
stewartsmith commented 1 year ago

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?

sebsto commented 1 year ago

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:

lstoll commented 8 months ago

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.

sebsto commented 7 months ago

Here is an easy script to install ld.gold from the sources on Amazon Linux 2023 https://gist.github.com/sebsto/219315a80333fb0661e03be2e0d00c80

daniejstriata commented 5 months ago

to build pandoc you need ld.gold

stewartsmith commented 5 months ago

The regular linker probably works fine (although I haven't tried it)

daniejstriata commented 5 months ago

for some reason the haskel cabal builds in EPEL need the ld.gold linker to build. ¯\_(ツ)_/¯