Skip to content

[main] rpm: install binutils-gold to work around build failure on Fedora 41 on arm64#390

Merged
thaJeztah merged 1 commit into
docker:mainfrom
thaJeztah:go_link_workaround
Aug 27, 2024
Merged

[main] rpm: install binutils-gold to work around build failure on Fedora 41 on arm64#390
thaJeztah merged 1 commit into
docker:mainfrom
thaJeztah:go_link_workaround

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

go1.21 and up have a patch that enforces the use of ld.gold to work around
a bug in GNU binutils. See;

Fedora 41 and up has a fixed version of binutils, and no longer requires that
patch, but will fail without ld.gold installed;

/usr/bin/gcc -Wl,-z,now -Wl,-z,nocopyreloc -fuse-ld=gold -o $WORK/b001/exe/a.out -rdynamic /tmp/go-link-1738353519/go.o /tmp/go-link-1738353519/000000.o /tmp/go-link-1738353519/000001.o /tmp/go-link-1738353519/000002.o /tmp/go-link-1738353519/000003.o /tmp/go-link-1738353519/000004.o /tmp/go-link-1738353519/000005.o /tmp/go-link-1738353519/000006.o /tmp/go-link-1738353519/000007.o /tmp/go-link-1738353519/000008.o /tmp/go-link-1738353519/000009.o /tmp/go-link-1738353519/000010.o /tmp/go-link-1738353519/000011.o /tmp/go-link-1738353519/000012.o /tmp/go-link-1738353519/000013.o /tmp/go-link-1738353519/000014.o /tmp/go-link-1738353519/000015.o /tmp/go-link-1738353519/000016.o /tmp/go-link-1738353519/000017.o /tmp/go-link-1738353519/000018.o /tmp/go-link-1738353519/000019.o /tmp/go-link-1738353519/000020.o /tmp/go-link-1738353519/000021.o /tmp/go-link-1738353519/000022.o /tmp/go-link-1738353519/000023.o /tmp/go-link-1738353519/000024.o -O2 -g -lresolv -O2 -g -lpthread -O2 -g -ldl -O2 -g
collect2: fatal error: cannot find 'ld'

Fedora's build of Go carries a patch for that, but it's not (yet) in upstream;

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah changed the title rpm: install to work around build failure on Fedora 41 on arm64 [main] rpm: install to work around build failure on Fedora 41 on arm64 Aug 27, 2024
@thaJeztah thaJeztah changed the title [main] rpm: install to work around build failure on Fedora 41 on arm64 [main] rpm: install binutils-gold to work around build failure on Fedora 41 on arm64 Aug 27, 2024
…on arm64

 go1.21 and up have a patch that enforces the use of ld.gold to work around
 a bug in GNU binutils. See;
 - golang/go#22040.
 - golang/go@cd77738

 Fedora 41 and up has a fixed version of binutils, and no longer requires that
 patch, but will fail without ld.gold installed;

    /usr/bin/gcc -Wl,-z,now -Wl,-z,nocopyreloc -fuse-ld=gold -o $WORK/b001/exe/a.out -rdynamic /tmp/go-link-1738353519/go.o /tmp/go-link-1738353519/000000.o /tmp/go-link-1738353519/000001.o /tmp/go-link-1738353519/000002.o /tmp/go-link-1738353519/000003.o /tmp/go-link-1738353519/000004.o /tmp/go-link-1738353519/000005.o /tmp/go-link-1738353519/000006.o /tmp/go-link-1738353519/000007.o /tmp/go-link-1738353519/000008.o /tmp/go-link-1738353519/000009.o /tmp/go-link-1738353519/000010.o /tmp/go-link-1738353519/000011.o /tmp/go-link-1738353519/000012.o /tmp/go-link-1738353519/000013.o /tmp/go-link-1738353519/000014.o /tmp/go-link-1738353519/000015.o /tmp/go-link-1738353519/000016.o /tmp/go-link-1738353519/000017.o /tmp/go-link-1738353519/000018.o /tmp/go-link-1738353519/000019.o /tmp/go-link-1738353519/000020.o /tmp/go-link-1738353519/000021.o /tmp/go-link-1738353519/000022.o /tmp/go-link-1738353519/000023.o /tmp/go-link-1738353519/000024.o -O2 -g -lresolv -O2 -g -lpthread -O2 -g -ldl -O2 -g
    collect2: fatal error: cannot find 'ld'

Fedora's build of Go carries a patch for that, but it's not (yet) in upstream;

- https://src.fedoraproject.org/rpms/golang/blob/a867bd88a656c1d6e91e7b18bab696dc3fcf1e77/f/0006-Default-to-ld.bfd-on-ARM64.patch
- https://src.fedoraproject.org/rpms/golang/c/a867bd88a656c1d6e91e7b18bab696dc3fcf1e77?branch=rawhide

- As a workaround; install binutils-gold

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah self-assigned this Aug 27, 2024
@thaJeztah thaJeztah merged commit 4b4798a into docker:main Aug 27, 2024
@thaJeztah thaJeztah deleted the go_link_workaround branch August 27, 2024 13:37
thaJeztah added a commit to thaJeztah/docker-ce-packaging that referenced this pull request Sep 4, 2024
This is the equivalent of docker/containerd-packaging#390
for containerd packages, but unlike for containerd packages, we currently do
not run into this issue when building docker-ce packages. We're installing
this as a precaution, but perhaps it's not needed.

go1.21 and up have a patch that enforces the use of ld.gold to work around
a bug in GNU binutils. See;

- golang/go#22040.
- golang/go@cd77738

Fedora 41 and up has a fixed version of binutils, and no longer requires that
patch, but may fail without ld.gold installed;

    /usr/bin/gcc -Wl,-z,now -Wl,-z,nocopyreloc -fuse-ld=gold -o $WORK/b001/exe/a.out -rdynamic /tmp/go-link-1738353519/go.o /tmp/go-link-1738353519/000000.o /tmp/go-link-1738353519/000001.o /tmp/go-link-1738353519/000002.o /tmp/go-link-1738353519/000003.o /tmp/go-link-1738353519/000004.o /tmp/go-link-1738353519/000005.o /tmp/go-link-1738353519/000006.o /tmp/go-link-1738353519/000007.o /tmp/go-link-1738353519/000008.o /tmp/go-link-1738353519/000009.o /tmp/go-link-1738353519/000010.o /tmp/go-link-1738353519/000011.o /tmp/go-link-1738353519/000012.o /tmp/go-link-1738353519/000013.o /tmp/go-link-1738353519/000014.o /tmp/go-link-1738353519/000015.o /tmp/go-link-1738353519/000016.o /tmp/go-link-1738353519/000017.o /tmp/go-link-1738353519/000018.o /tmp/go-link-1738353519/000019.o /tmp/go-link-1738353519/000020.o /tmp/go-link-1738353519/000021.o /tmp/go-link-1738353519/000022.o /tmp/go-link-1738353519/000023.o /tmp/go-link-1738353519/000024.o -O2 -g -lresolv -O2 -g -lpthread -O2 -g -ldl -O2 -g
    collect2: fatal error: cannot find 'ld'

Fedora's build of Go carries a patch for that, but it's not (yet) in upstream;
- https://src.fedoraproject.org/rpms/golang/blob/a867bd88a656c1d6e91e7b18bab696dc3fcf1e77/f/0006-Default-to-ld.bfd-on-ARM64.patch
- https://src.fedoraproject.org/rpms/golang/c/a867bd88a656c1d6e91e7b18bab696dc3fcf1e77?branch=rawhide

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah added a commit to thaJeztah/docker-ce-packaging that referenced this pull request Sep 4, 2024
This is the equivalent of docker/containerd-packaging#390
for containerd packages, but unlike for containerd packages, we currently do
not run into this issue when building docker-ce packages. We're installing
this as a precaution, but perhaps it's not needed.

go1.21 and up have a patch that enforces the use of ld.gold to work around
a bug in GNU binutils. See;

- golang/go#22040.
- golang/go@cd77738

Fedora 41 and up has a fixed version of binutils, and no longer requires that
patch, but may fail without ld.gold installed;

    /usr/bin/gcc -Wl,-z,now -Wl,-z,nocopyreloc -fuse-ld=gold -o $WORK/b001/exe/a.out -rdynamic /tmp/go-link-1738353519/go.o /tmp/go-link-1738353519/000000.o /tmp/go-link-1738353519/000001.o /tmp/go-link-1738353519/000002.o /tmp/go-link-1738353519/000003.o /tmp/go-link-1738353519/000004.o /tmp/go-link-1738353519/000005.o /tmp/go-link-1738353519/000006.o /tmp/go-link-1738353519/000007.o /tmp/go-link-1738353519/000008.o /tmp/go-link-1738353519/000009.o /tmp/go-link-1738353519/000010.o /tmp/go-link-1738353519/000011.o /tmp/go-link-1738353519/000012.o /tmp/go-link-1738353519/000013.o /tmp/go-link-1738353519/000014.o /tmp/go-link-1738353519/000015.o /tmp/go-link-1738353519/000016.o /tmp/go-link-1738353519/000017.o /tmp/go-link-1738353519/000018.o /tmp/go-link-1738353519/000019.o /tmp/go-link-1738353519/000020.o /tmp/go-link-1738353519/000021.o /tmp/go-link-1738353519/000022.o /tmp/go-link-1738353519/000023.o /tmp/go-link-1738353519/000024.o -O2 -g -lresolv -O2 -g -lpthread -O2 -g -ldl -O2 -g
    collect2: fatal error: cannot find 'ld'

Fedora's build of Go carries a patch for that, but it's not (yet) in upstream;
- https://src.fedoraproject.org/rpms/golang/blob/a867bd88a656c1d6e91e7b18bab696dc3fcf1e77/f/0006-Default-to-ld.bfd-on-ARM64.patch
- https://src.fedoraproject.org/rpms/golang/c/a867bd88a656c1d6e91e7b18bab696dc3fcf1e77?branch=rawhide

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 563068b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants