Skip to content

Build and include ld.gold linker in binutils-aarch64-linux-gnu package #11886

@nahwneeth

Description

@nahwneeth

Is your feature request related to a problem? Please describe.
The binutils-aarch64-linux-gnu package does not contain ld.gold binary. This is a linker that is required for cross compiling golang code (that makes use of cgo) to arm64. The arm64 build fails if the gold linker is missing - due to this check.

The native versions of the binutils package (both x86_64 and aarch64) contain the ld.gold binary. But it is missing in the binutils-aarch64-linux-gnu package due to which we are not able to cross compile go code.

Image

Describe the solution you'd like
The ld.gold binary is be generated by configuring binutils with the --enable-gold flag. This flag is already enabled for the binutils native targets. Adding this flag for the binutils cross targets as well would solve this issue.

%configure \
--exec-prefix=%{auxbin_prefix} \
--program-prefix=$target- \
--target=$target \
--disable-multilib \
--disable-nls \
--disable-install_libbfd \
--with-sysroot=%{_prefix}/$target/sys-root

Describe alternatives you've considered
Alternative considered was to build binutils ourselves from source configured with --enable-gold. However, this would require us to patch CVEs as well. Since the AzureLinux team patches CVEs regularly, we believe it would help us stay more secure if we consume it from the AzureLinux repository.

Additional context
Removing the ld.gold dependency for cross compiling go code to arm64 has been open for a while now - golang/go#22040. In the meantime, having the ld.gold linker would help unblock us and I believe this should not cause any other issues as it's already present in aarch64 binutils package.

OS version: Mariner 2.0, AzureLinux 3.0
binutils package version: 2.37-10.cm2.x86_64, 2.41-2.azl3.x86_64

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestRequest for a feature or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions