-
Notifications
You must be signed in to change notification settings - Fork 603
Description
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.
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.
azurelinux/SPECS/binutils/binutils.spec
Lines 111 to 118 in c927bff
| %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
