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

cmd/link: bad carrier sym for symbol runtime.elf_savegpr0.args_stackmap on ppc64le #66265

Closed
nmeum opened this issue Mar 12, 2024 · 4 comments
Closed
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@nmeum
Copy link

nmeum commented Mar 12, 2024

Go version

go version go1.22.1 linux/ppc64le

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='ppc64le'
GOBIN=''
GOCACHE='/home/buildozer/.cache/go-build'
GOENV='/home/buildozer/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS='-buildmode=pie'
GOHOSTARCH='ppc64le'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/buildozer/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/buildozer/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/lib/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/usr/lib/go/pkg/tool/linux_ppc64le'
GOVCS=''
GOVERSION='go1.22.1'
GCCGO='gccgo'
GOPPC64='power8'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/tmp/goimapnotify/go.mod'
GOWORK=''
CGO_CFLAGS='-Os -fstack-clash-protection'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2019875689=/tmp/go-build -gno-record-gcc-switches'

What did you do?

I maintain the Go package for Alpine Linux. While rebuilding all of our packaged Go software for the 1.22.1 security release, we encountered several packages which failed to build on ppc64le with a linking error. These packages previously built fine with Go 1.21, hence we believe this to be a regression with Go 1.22.

One example of such software is goimapnotify:

$ git clone https://gitlab.com/shackra/goimapnotify.git
$ cd goimapnotify
$ git checkout 2.3.11
$ export CGO_CFLAGS="-Os -fstack-clash-protection"
$ export GOFLAGS="-buildmode=pie"
$ go build

What did you see happen?

A build failure with a linker error message:

go: downloading github.com/emersion/go-imap v1.0.0-beta.4.0.20190414203716-b7db4a2bc5cc
go: downloading github.com/emersion/go-imap-idle v0.0.0-20180114101550-2af93776db6b
go: downloading github.com/sirupsen/logrus v1.8.1
go: downloading github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21
go: downloading golang.org/x/text v0.3.2
go: downloading golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6
# gitlab.com/shackra/goimapnotify
panic: bad carrier sym for symbol runtime.elf_savegpr0.args_stackmap (funcdata runtime.elf_savegpr0#0), want go:func.* got ?

goroutine 61 [running]:
cmd/link/internal/ld.writeFuncs(0xc0001a0000, 0xc0012940c0, {0xc000ab7500, 0x12e4, 0xc001174000?}, 0xc000e73b90, {0xc001174000, 0x12e4, 0x1bd8d?}, {0xc000520240, ...}, ...)
        cmd/link/internal/ld/pcln.go:747 +0xc20
cmd/link/internal/ld.(*pclntab).generateFunctab.func1(0xc0001a0000, 0x11eb40?)
        cmd/link/internal/ld/pcln.go:544 +0x100
cmd/link/internal/ld.writeBlock(0xc0001a0000, 0xc0001507e0, 0xc000154008, {0xc001826f20?, 0x544c60?, 0x200?}, 0x200?, 0x7?, {0x544c60, 0x200, ...})
        cmd/link/internal/ld/data.go:1092 +0x434
cmd/link/internal/ld.writeBlocks.func1(0xc00117e5e0?, 0xc00117e5e0?, {0xc001826f20?, 0xc000150620?, 0x540000?}, 0x1c1eb3?, 0x100000000000000?, {0x544c60?, 0xc00117e2b0?, 0xc0012187a8?})
        cmd/link/internal/ld/data.go:1045 +0xc0
created by cmd/link/internal/ld.writeBlocks in goroutine 55
        cmd/link/internal/ld/data.go:1044 +0x50c

Please note, this only happens when both GOFLAGS and CGO_CFLAGS is set.

The downstream bug report is: https://gitlab.alpinelinux.org/alpine/aports/-/issues/15862

What did you expect to see?

A successful build.

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Mar 12, 2024
@pmur pmur self-assigned this Mar 12, 2024
@gopherbot
Copy link

Change https://go.dev/cl/571136 mentions this issue: cmd/internal/obj: on PPC64, don't generate stackmap symbols for linker functions

@mknyszek mknyszek added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 13, 2024
@mknyszek mknyszek added this to the Go1.23 milestone Mar 13, 2024
@gopherbot
Copy link

Change https://go.dev/cl/571835 mentions this issue: cmd/internal/obj/ppc64: don't modify runtime.elf_* symbols

@pmur
Copy link
Contributor

pmur commented Mar 19, 2024

@gopherbot please consider a backport for go 1.21 and go 1.22 as this prevents building certain cgo applications as PIE binaries.

@gopherbot
Copy link

Backport issue(s) opened: #66411 (for 1.21), #66412 (for 1.22).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.

algitbot pushed a commit to alpinelinux/aports that referenced this issue Mar 20, 2024
bell-sw pushed a commit to bell-sw/alpaquita-aports that referenced this issue Mar 22, 2024
[ commit 44d75fb4ce0668886aae23f08ecdef79209f42d1 ]

See golang/go#66265

Fixes: #15862
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Projects
Development

No branches or pull requests

4 participants