Skip to content
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

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

Open
nahwneeth opened this issue Jan 13, 2025 · 1 comment
Open
Labels
feature-request Request for a feature or enhancement

Comments

@nahwneeth
Copy link

nahwneeth commented Jan 13, 2025

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

@nahwneeth nahwneeth added the feature-request Request for a feature or enhancement label Jan 13, 2025
@nahwneeth
Copy link
Author

The exact error we are getting from go:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for a feature or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant