Go version

go1.25rc2

Output of go env in your module/workspace:

Unknown at this time.

What did you do?

Running through GitHub CI runners on x64 host platform cross compiling, we are seeing linker failures running the go test -c command with the -race flag enabled on aarch64 and s390x platforms under 1.25.rc2. The same tests compile without the -race flag on all platforms properly.

Of note we aren't seeing the linker failures other platforms such as armv6, armv7, 386, x64.

This does seem to work properly using 1.24.4 and previous versions of Go.

See: https://github.com/petermattis/goid/actions/runs/16358274496/job/46221706467?pr=61

What did you see happen?

The following error is returned

+ go test -c -race -o goid.race.test ./...
# github.com/petermattis/goid.test
/opt/hostedtoolcache/go/1.25.0-rc.2/x64/pkg/tool/linux_amd64/link: running aarch64-linux-gnu-gcc failed: exit status 1
/usr/bin/aarch64-linux-gnu-gcc -Wl,--build-id=0xd0880a43064c97283ad4ffa2b14213a6c4ad456c -o $WORK/b001/goid.test -Wl,--export-dynamic-symbol=_cgo_panic -Wl,--export-dynamic-symbol=_cgo_topofstack -Wl,--export-dynamic-symbol=crosscall2 -Wl,--compress-debug-sections=zlib /tmp/go-link-1830713424/go.o /tmp/go-link-1830713424/000000.o /tmp/go-link-1830713424/000001.o /tmp/go-link-1830713424/000002.o /tmp/go-link-1830713424/000003.o /tmp/go-link-1830713424/000004.o /tmp/go-link-1830713424/000005.o /tmp/go-link-1830713424/000006.o /tmp/go-link-1830713424/000007.o /tmp/go-link-1830713424/000008.o /tmp/go-link-1830713424/000009.o /tmp/go-link-1830713424/000010.o /tmp/go-link-1830713424/000011.o /tmp/go-link-1830713424/000012.o /tmp/go-link-1830713424/000013.o /tmp/go-link-1830713424/000014.o /tmp/go-link-1830713424/000015.o /tmp/go-link-1830713424/000016.o -O2 -g -O2 -g -lpthread -no-pie
/tmp/go-link-1830713424/000002.o: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status

What did you expect to see?

All supported platforms should be able to compile the test suite with the -race flag, considering this seems to work properly using prior versions of Go.

Comment From: gabyhelp

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

Comment From: cherrymui

curl --location --output "$(go env GOROOT)"/src/runtime/race/race_linux_"$GOARCH".syso \ https://github.com/golang/go/raw/release-branch.go1.25.0-rc.2/src/runtime/race/race_linux_"$GOARCH".syso

I don't know how you get that URL, but that just gives 404. Try https://github.com/golang/go/raw/release-branch.go1.25/src/runtime/race/race_linux_arm64.syso

The "file format not recognized" error is probably just that the "object file" is actually a 404 page.

Comment From: stevendpclark

Oops thanks @cherrymui for getting back to me on this so quickly.

Comment From: tamird

Yes, this is PEBKAC. The CI script tries to download from https://github.com/golang/go/raw/release-branch.go${{ matrix.go }}/src/runtime/race/race_linux_"$GOARCH".syso which doesn't work when we're using an RC.

I fixed it in https://github.com/petermattis/goid/pull/61/commits/173a0336d19f33cb749bd0ceb255a228d23a10cc.