Skip to content

[main] Revert "Jenkinsfile: temporarily disable Fedora Rawhide"#371

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

[main] Revert "Jenkinsfile: temporarily disable Fedora Rawhide"#371
thaJeztah merged 1 commit into
docker:mainfrom
thaJeztah:reenable_rawhide

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

This reverts commit c1625f7.

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

@thaJeztah thaJeztah self-assigned this Jun 18, 2024
@thaJeztah thaJeztah changed the title Revert "Jenkinsfile: temporarily disable Fedora Rawhide" [main] Revert "Jenkinsfile: temporarily disable Fedora Rawhide" Jun 18, 2024
@thaJeztah
Copy link
Copy Markdown
Member Author

New error this time;

 > [build-env 7/7] RUN . /root/.rpm-helpers; install_build_deps SPECS/containerd.spec:
0.181 + SPEC_FILE=SPECS/containerd.spec
0.181 + export RPM_VERSION=0.0.1
0.181 + RPM_VERSION=0.0.1
0.181 + export RPM_RELEASE_VERSION=dev
0.181 + RPM_RELEASE_VERSION=dev
0.181 + type yum-builddep
0.182 + type dnf
0.182 + dnf builddep -y SPECS/containerd.spec
0.204 Unknown argument "builddep" for command "dnf5". Add "--help" for more information about the arguments.
0.204 It could be a command provided by a plugin, try: dnf5 install 'dnf5-command(builddep)'

@thaJeztah
Copy link
Copy Markdown
Member Author

Ha! Looks like we found a bug in our script; this PR rand a build from the same commit that was used to tag the new containerd api module.

As that's a sub module, it must be tagged with the module path as prefix; in this case api/v1.7.19. That tag doesn't have anything to do with the containerd main module, and thus nothing to do with the binaries, our script picked up the tag, and wasn't prepared for the / to be in there;


#27 [build-packages 3/4] RUN --mount=type=bind,from=golang,source=/usr/local/go/,target=/usr/local/go/     --mount=type=bind,source=/src,target=/go/src,rw     --mount=type=bind,source=/src/github.com/containerd/containerd,target=/root/rpmbuild/SOURCES/containerd     --mount=type=bind,source=/src/github.com/opencontainers/runc,target=/root/rpmbuild/SOURCES/runc     /root/build-rpm
#27 0.331 + SPEC_FILE=SPECS/containerd.spec
#27 0.331 + export RPM_VERSION=api/v1.7.19
#27 0.331 + RPM_VERSION=api/v1.7.19
#27 0.331 + export RPM_RELEASE_VERSION=3
#27 0.331 + RPM_RELEASE_VERSION=3
#27 0.331 + type yum-builddep
#27 0.331 + type dnf
#27 0.331 + dnf builddep -y SPECS/containerd.spec
#27 1.291 Last metadata expiration check: 0:00:29 ago on Wed Jun 26 11:51:43 2024.
#27 1.301 RPM: error: line 47: Illegal char '/' (0x2f) in: Version: api/v1.7.19
#27 1.301 Failed to open: 'SPECS/containerd.spec', not a valid spec file: can't parse specfile
#27 1.301 
#27 1.315 Error: Some packages could not be found.
#27 ERROR: process "/bin/sh -c /root/build-rpm" did not complete successfully: exit code: 1
------

@thaJeztah
Copy link
Copy Markdown
Member Author

Error above should be fixed through #375

#27 1.301 RPM: error: line 47: Illegal char '/' (0x2f) in: Version: api/v1.7.19

@thaJeztah
Copy link
Copy Markdown
Member Author

Remaining failure on aarch64 (arm64)

Details
#21 [build-packages 3/4] RUN --mount=type=bind,from=golang,source=/usr/local/go/,target=/usr/local/go/     --mount=type=bind,source=/src,target=/go/src,rw     --mount=type=bind,source=/src/github.com/containerd/containerd,target=/root/rpmbuild/SOURCES/containerd     --mount=type=bind,source=/src/github.com/opencontainers/runc,target=/root/rpmbuild/SOURCES/runc     /root/build-rpm
#21 0.287 fatal: No tags can describe 'c3bed76eeb24ab6671a8134ce32fd2b22b0af667'.
#21 0.287 Try --always, or create some tags.
#21 0.301 + SPEC_FILE=SPECS/containerd.spec
#21 0.301 + export RPM_VERSION=0.20240723.181935~c3bed76
#21 0.301 + RPM_VERSION=0.20240723.181935~c3bed76
#21 0.301 + export RPM_RELEASE_VERSION=0
#21 0.301 + RPM_RELEASE_VERSION=0
#21 0.301 + type dnf
#21 0.301 + dnf builddep -y SPECS/containerd.spec
#21 0.380 Updating and loading repositories:
#21 0.627 Repositories loaded.
#21 0.794 Package "gcc-14.1.1-7.fc41.aarch64" is already installed.
#21 0.794 Package "libseccomp-devel-2.5.5-2.fc41.aarch64" is already installed.
#21 0.794 Package "make-1:4.4.1-8.fc41.aarch64" is already installed.
#21 0.794 Package "systemd-256.2-16.fc41.aarch64" is already installed.
#21 0.794 
#21 0.794 Nothing to do.
#21 0.806 + rpmbuild -ba SPECS/containerd.spec
#21 0.814 warning: line 40: It's not recommended to have unversioned Obsoletes: Obsoletes: containerd
#21 0.814 warning: line 41: It's not recommended to have unversioned Obsoletes: Obsoletes: runc
#21 0.830 setting SOURCE_DATE_EPOCH=1721088000
#21 0.840 Executing(%mkbuilddir): /bin/sh -e /var/tmp/rpm-tmp.f74Beh
#21 0.841 + umask 022
#21 0.841 + cd /root/rpmbuild/BUILD/containerd.io-0.20240723.181935_c3bed76-build
#21 0.841 + test -d /root/rpmbuild/BUILD/containerd.io-0.20240723.181935_c3bed76-build
#21 0.841 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w /root/rpmbuild/BUILD/containerd.io-0.20240723.181935_c3bed76-build
#21 0.842 + /usr/bin/rm -rf /root/rpmbuild/BUILD/containerd.io-0.20240723.181935_c3bed76-build
#21 0.843 + /usr/bin/mkdir -p /root/rpmbuild/BUILD/containerd.io-0.20240723.181935_c3bed76-build
#21 0.844 + /usr/bin/mkdir -p /root/rpmbuild/BUILD/containerd.io-0.20240723.181935_c3bed76-build/SPECPARTS
#21 0.845 + RPM_EC=0
#21 0.846 ++ jobs -p
#21 0.846 + exit 0
#21 0.848 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.Fq36Jc
#21 0.849 + umask 022
#21 0.849 + cd /root/rpmbuild/BUILD/containerd.io-0.20240723.181935_c3bed76-build
#21 0.849 + rm -rf /root/rpmbuild/BUILD/containerd.io-0.20240723.181935_c3bed76-build
#21 0.850 + '[' '!' -d /root/rpmbuild/SOURCES/containerd ']'
#21 0.850 + ln -s /go/src/github.com/containerd/containerd /root/rpmbuild/BUILD/containerd.io-0.20240723.181935_c3bed76-build
#21 0.851 + '[' '!' -d /root/rpmbuild/SOURCES/runc ']'
#21 0.851 + cd /root/rpmbuild/BUILD/containerd.io-0.20240723.181935_c3bed76-build
#21 0.851 + RPM_EC=0
#21 0.851 ++ jobs -p
#21 0.852 + exit 0
#21 0.854 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.D4YWG0
#21 0.855 + umask 022
#21 0.855 + cd /root/rpmbuild/BUILD/containerd.io-0.20240723.181935_c3bed76-build
#21 0.855 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
#21 0.855 + export CFLAGS
#21 0.855 + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
#21 0.855 + export CXXFLAGS
#21 0.855 + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
#21 0.855 + export FFLAGS
#21 0.855 + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
#21 0.855 + export FCFLAGS
#21 0.855 + VALAFLAGS=-g
#21 0.855 + export VALAFLAGS
#21 0.855 + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes -Clink-arg=-specs=/usr/lib/rpm/redhat/redhat-package-notes --cap-lints=warn'
#21 0.856 + export RUSTFLAGS
#21 0.856 + LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes '
#21 0.856 + export LDFLAGS
#21 0.856 + LT_SYS_LIBRARY_PATH=/usr/lib64:
#21 0.856 + export LT_SYS_LIBRARY_PATH
#21 0.856 + CC=gcc
#21 0.856 + export CC
#21 0.856 + CXX=g++
#21 0.856 + export CXX
#21 0.856 + cd /root/rpmbuild/BUILD/containerd.io-0.20240723.181935_c3bed76-build
#21 0.856 + make man
#21 1.780 + bin/gen-manpages
#21 1.780 go build  -gcflags=-trimpath=/go/src -buildmode=pie  -o bin/gen-manpages -ldflags '-X github.com/containerd/containerd/v2/version.Version=0.20240723.181935~c3bed76 -X github.com/containerd/containerd/v2/version.Revision=c3bed76eeb24ab6671a8134ce32fd2b22b0af667 -X github.com/containerd/containerd/v2/version.Package=github.com/containerd/containerd/v2 -s -w ' -tags ""  ./cmd/gen-manpages
#21 17.14 # github.com/containerd/containerd/v2/cmd/gen-manpages
#21 17.14 /usr/local/go/pkg/tool/linux_arm64/link: running gcc failed: exit status 1
#21 17.14 collect2: fatal error: cannot find ‘ld’
#21 17.14 compilation terminated.
#21 17.14 
#21 17.26 make: *** [Makefile:263: bin/gen-manpages] Error 1
#21 17.26 error: Bad exit status from /var/tmp/rpm-tmp.D4YWG0 (%build)
#21 17.26     line 40: It's not recommended to have unversioned Obsoletes: Obsoletes: containerd
#21 17.26     line 41: It's not recommended to have unversioned Obsoletes: Obsoletes: runc
#21 17.26     Bad exit status from /var/tmp/rpm-tmp.D4YWG0 (%build)
#21 17.26 
#21 17.26 RPM build warnings:
#21 17.26 
#21 17.26 RPM build errors:
#21 ERROR: process "/bin/sh -c /root/build-rpm" did not complete successfully: exit code: 1
------
 > [build-packages 3/4] RUN --mount=type=bind,from=golang,source=/usr/local/go/,target=/usr/local/go/     --mount=type=bind,source=/src,target=/go/src,rw     --mount=type=bind,source=/src/github.com/containerd/containerd,target=/root/rpmbuild/SOURCES/containerd     --mount=type=bind,source=/src/github.com/opencontainers/runc,target=/root/rpmbuild/SOURCES/runc     /root/build-rpm:
17.14 
17.26 make: *** [Makefile:263: bin/gen-manpages] Error 1
17.26 error: Bad exit status from /var/tmp/rpm-tmp.D4YWG0 (%build)
17.26     line 40: It's not recommended to have unversioned Obsoletes: Obsoletes: containerd
17.26     line 41: It's not recommended to have unversioned Obsoletes: Obsoletes: runc
17.26     Bad exit status from /var/tmp/rpm-tmp.D4YWG0 (%build)
17.26 
17.26 RPM build warnings:
17.26 
17.26 RPM build errors:
------
rpm.dockerfile:102
--------------------
 101 |     #       with CGO when building multiple distros on the same machine / build-cache
 102 | >>> RUN --mount=type=bind,from=golang,source=/usr/local/go/,target=/usr/local/go/ \
 103 | >>>     --mount=type=bind,source=/src,target=/go/src,rw \
 104 | >>>     --mount=type=bind,source=/src/github.com/containerd/containerd,target=/root/rpmbuild/SOURCES/containerd \
 105 | >>>     --mount=type=bind,source=/src/github.com/opencontainers/runc,target=/root/rpmbuild/SOURCES/runc \
 106 | >>>     /root/build-rpm
 107 |     ARG UID=0
--------------------
ERROR: failed to solve: process "/bin/sh -c /root/build-rpm" did not complete successfully: exit code: 1
make[1]: *** [Makefile:95: build] Error 1
make[1]: Leaving directory '/home/ubuntu/workspace/containerd-packaging_PR-371'
make: *** [Makefile:73: docker.io/library/fedora:rawhide] Error 2
script returned exit code 2

Error is here;

go build  -gcflags=-trimpath=/go/src -buildmode=pie  -o bin/gen-manpages -ldflags '-X github.com/containerd/containerd/v2/version.Version=0.20240723.181935~c3bed76 -X github.com/containerd/containerd/v2/version.Revision=c3bed76eeb24ab6671a8134ce32fd2b22b0af667 -X github.com/containerd/containerd/v2/version.Package=github.com/containerd/containerd/v2 -s -w ' -tags ""  ./cmd/gen-manpages
# github.com/containerd/containerd/v2/cmd/gen-manpages
/usr/local/go/pkg/tool/linux_arm64/link: running gcc failed: exit status 1
collect2: fatal error: cannot find ‘ld’
compilation terminated.

Found a StackOverflow question about a similar case, but need to do more searching; https://stackoverflow.com/questions/35970824/gcc-collect2-fatal-error-cannot-find-ld

@thaJeztah
Copy link
Copy Markdown
Member Author

Looks like it also fails on Fedora 41 (not yet released);

  • Works with containerd 1.7, but fails on main (but could be go version)
  • Minimal reproducer building the gen-manpages binary
  • It fails with the golang:1.23 (and 1.22) image, but passes with fedora's golang package

Dockerfile used to test variations;

# syntax=docker/dockerfile:1

ARG USE=pkg

FROM fedora:41 AS base
ENV GOPATH=/go
ENV GOTOOLCHAIN=local
ENV PATH="${PATH}:/usr/local/go/bin:${GOPATH}/bin"
ENV CC=gcc
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH"
RUN dnf install -y gcc
ADD --link https://github.com/containerd/containerd.git /containerd
WORKDIR /containerd/

FROM base AS golangimg
COPY --link --from=golang:1.23 /usr/local/go /usr/local/go

FROM base AS golangpkg
RUN dnf install -y golang

FROM golang${USE}
RUN ldd $(command -v go) || true
RUN go version -v $(command -v go)
RUN go version
RUN go build  -o bin/gen-manpages  ./cmd/gen-manpages

Building with the Fedora package;

docker build --no-cache --progress=plain --build-arg USE=pkg .

#12 [golangpkg 1/1] RUN dnf install -y golang
#12 CACHED

#13 [stage-3 1/4] RUN ldd $(command -v go) || true
#13 0.110 	not a dynamic executable
#13 DONE 0.1s

#14 [stage-3 2/4] RUN go version -v $(command -v go)
#14 0.168 /usr/bin/go: go1.23.0
#14 DONE 0.2s

#15 [stage-3 3/4] RUN go version
#15 0.118 go version go1.23.0 linux/arm64
#15 DONE 0.1s

#16 [stage-3 4/4] RUN go build  -o bin/gen-manpages  ./cmd/gen-manpages
#16 DONE 12.9s

Building with the Golang image

docker build --no-cache --progress=plain --build-arg USE=img .

#14 [golangimg 1/1] COPY --link --from=golang:1.23 /usr/local/go /usr/local/go
#14 CACHED

#15 [stage-3 1/4] RUN ldd $(command -v go) || true
#15 0.116 	not a dynamic executable
#15 DONE 0.1s

#16 [stage-3 2/4] RUN go version -v $(command -v go)
#16 0.190 /usr/local/go/bin/go: go1.23.0
#16 DONE 0.2s

#17 [stage-3 3/4] RUN go version
#17 0.134 go version go1.23.0 linux/arm64
#17 DONE 0.1s

#18 [stage-3 4/4] RUN go build  -o bin/gen-manpages  ./cmd/gen-manpages
#18 11.38 # github.com/containerd/containerd/v2/cmd/gen-manpages
#18 11.38 /usr/local/go/pkg/tool/linux_arm64/link: running gcc failed: exit status 1
#18 11.38 /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
#18 11.38 collect2: fatal error: cannot find 'ld'
#18 11.38 compilation terminated.
#18 11.38
#18 ERROR: process "/bin/sh -c go build  -o bin/gen-manpages  ./cmd/gen-manpages" did not complete successfully: exit code: 1
------
 > [stage-3 4/4] RUN go build  -o bin/gen-manpages  ./cmd/gen-manpages:
11.38 # github.com/containerd/containerd/v2/cmd/gen-manpages
11.38 /usr/local/go/pkg/tool/linux_arm64/link: running gcc failed: exit status 1
11.38 /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
11.38 collect2: fatal error: cannot find 'ld'
11.38 compilation terminated.
11.38
------
Dockerfile:25
--------------------
  23 |     RUN go version -v $(command -v go)
  24 |     RUN go version
  25 | >>> RUN go build  -o bin/gen-manpages  ./cmd/gen-manpages
  26 |
--------------------
ERROR: failed to solve: process "/bin/sh -c go build  -o bin/gen-manpages  ./cmd/gen-manpages" did not complete successfully: exit code: 1

@thaJeztah
Copy link
Copy Markdown
Member Author

thaJeztah commented Aug 27, 2024

This patch in Fedora's packages looks related; https://src.fedoraproject.org/rpms/golang/blob/rawhide/f/0006-Default-to-ld.bfd-on-ARM64.patch / https://src.fedoraproject.org/rpms/golang/blob/a867bd88a656c1d6e91e7b18bab696dc3fcf1e77/f/0006-Default-to-ld.bfd-on-ARM64.patch

From 46ec67413008607e2150e3395668e54e538c5b6b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20S=C3=A1ez?= <asm@redhat.com>
Date: Wed, 19 Jun 2024 10:18:58 +0200
Subject: [PATCH] Default to ld.bfd on ARM64

---
 src/cmd/link/internal/ld/lib.go | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
index eab74dc328..b401f58727 100644
--- a/src/cmd/link/internal/ld/lib.go
+++ b/src/cmd/link/internal/ld/lib.go
@@ -1620,22 +1620,16 @@ func (ctxt *Link) hostlink() {
 		}
 
 		if ctxt.Arch.InFamily(sys.ARM64) && buildcfg.GOOS == "linux" {
-			// On ARM64, the GNU linker will fail with
-			// -znocopyreloc if it thinks a COPY relocation is
-			// required. Switch to gold.
-			// https://sourceware.org/bugzilla/show_bug.cgi?id=19962
-			// https://go.dev/issue/22040
-			altLinker = "gold"
-
-			// If gold is not installed, gcc will silently switch
-			// back to ld.bfd. So we parse the version information
-			// and provide a useful error if gold is missing.
+			// Use ld.bfd as the default linker
+			altLinker = "bfd"
+
+			// Provide a useful error if ld.bfd is missing
 			name, args := flagExtld[0], flagExtld[1:]
-			args = append(args, "-fuse-ld=gold", "-Wl,--version")
+			args = append(args, "-fuse-ld=bfd", "-Wl,--version")
 			cmd := exec.Command(name, args...)
 			if out, err := cmd.CombinedOutput(); err == nil {
-				if !bytes.Contains(out, []byte("GNU gold")) {
-					log.Fatalf("ARM64 external linker must be gold (issue #15696, 22040), but is not: %s", out)
+				if !bytes.Contains(out, []byte("GNU ld")) {
+					log.Fatalf("ARM64 external linker must be ld.bfd, but is not: %s", out)
 				}
 			}
 		}
-- 
2.45.1

That patch is related to https://go.dev/issue/22040;

So go contains a workaround (added in golang/go@cd77738 - go1.21), but that enforces the uses of ld.gold, meaning that on Fedora 41 it cannot use the ld.bfd. The patch above reverts that change, but now means the reverse (gold not allowed); https://github.com/golang/go/blob/36b45bca66d86020f0b4daf1f15b02921a8dad43/src/cmd/link/internal/ld/lib.go#L1661-L1680

This reverts commit c1625f7.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah marked this pull request as ready for review August 27, 2024 13:38
Copy link
Copy Markdown
Contributor

@vvoland vvoland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (assuming green)

@thaJeztah thaJeztah merged commit c96215d into docker:main Aug 27, 2024
@thaJeztah thaJeztah deleted the reenable_rawhide branch August 27, 2024 13:50
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