Skip to content

cmd/link: unexpected trampoline error on ppc64le musl with -buildmode=pie #52337

Closed
@nmeum

Description

@nmeum

This is (probably) related to #52336 and #51787.

What version of Go are you using (go version)?

$ go version
go version go1.18.1 linux/ppc64le

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="ppc64le"
GOBIN=""
GOCACHE="/home/buildozer/.cache/go-build"
GOENV="/home/buildozer/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
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=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_ppc64le"
GOVCS=""
GOVERSION="go1.18.1"
GCCGO="gccgo"
GOPPC64="power8"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1359095760=/tmp/go-build -gno-record-gcc-switches"

What did you do?

This is issue we encountered when packaging Go software for Alpine Linux Edge ppc64le. On all other architectures, supported by Alpine, the affected Go software builds fine but on ppc64le it fails with a "unexpected trampoline for shared or dynamic linking" error (see also #52336 and #51787).

This issue can only be reproduced with -buildmode=pie.

One software where this can be reproduced is vault (I have not yet been able to create a minimal example):

$ git clone https://github.com/hashicorp/vault
$ cd vault
$ go build -buildmode=pie -o test

See also #51787 (comment)

What did you expect to see?

A successful build.

What did you see instead?

The following error message:

k8s.io/api/extensions/v1beta1.(*ScaleStatus).MarshalToSizedBuffer: unexpected trampoline for shared or dynamic linking
k8s.io/api/extensions/v1beta1.(*ScaleStatus).MarshalToSizedBuffer: unexpected trampoline for shared or dynamic linking
k8s.io/api/extensions/v1beta1.(*ScaleStatus).MarshalToSizedBuffer: unexpected trampoline for shared or dynamic linking
k8s.io/api/extensions/v1beta1.(*ScaleStatus).MarshalToSizedBuffer: unexpected trampoline for shared or dynamic linking
k8s.io/api/extensions/v1beta1.(*DeploymentRollback).Size: unexpected trampoline for shared or dynamic linking
k8s.io/api/extensions/v1beta1.(*DeploymentRollback).Size: unexpected trampoline for shared or dynamic linking
k8s.io/api/extensions/v1beta1.(*ScaleStatus).Size: unexpected trampoline for shared or dynamic linking
k8s.io/api/extensions/v1beta1.(*ScaleStatus).Size: unexpected trampoline for shared or dynamic linking
k8s.io/api/extensions/v1beta1.(*AllowedCSIDriver).String: unexpected trampoline for shared or dynamic linking
k8s.io/api/extensions/v1beta1.(*AllowedFlexVolume).String: unexpected trampoline for shared or dynamic linking
k8s.io/api/extensions/v1beta1.(*AllowedHostPath).String: unexpected trampoline for shared or dynamic linking
k8s.io/api/extensions/v1beta1.(*DaemonSet).String: unexpected trampoline for shared or dynamic linking
k8s.io/api/extensions/v1beta1.(*DaemonSetCondition).String: unexpected trampoline for shared or dynamic linking
k8s.io/api/extensions/v1beta1.(*DaemonSetCondition).String: unexpected trampoline for shared or dynamic linking
k8s.io/api/extensions/v1beta1.(*DaemonSetCondition).String: unexpected trampoline for shared or dynamic linking
k8s.io/api/extensions/v1beta1.(*DaemonSetCondition).String: unexpected trampoline for shared or dynamic linking
k8s.io/api/extensions/v1beta1.(*DaemonSetCondition).String: unexpected trampoline for shared or dynamic linking
k8s.io/api/extensions/v1beta1.(*DaemonSetList).String: unexpected trampoline for shared or dynamic linking
k8s.io/api/extensions/v1beta1.(*DaemonSetSpec).String: unexpected trampoline for shared or dynamic linking
k8s.io/api/extensions/v1beta1.(*DaemonSetSpec).String: unexpected trampoline for shared or dynamic linking
k8s.io/api/extensions/v1beta1.(*DaemonSetSpec).String: unexpected trampoline for shared or dynamic linking

CC: @pmur, @cherrymui

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions