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: arm: net(.text): direct call too far: .plt 873e4e #30949

Open
anguslees opened this issue Mar 20, 2019 · 4 comments

Comments

@anguslees
Copy link

commented Mar 20, 2019

While compiling kubernetes for linux/arm using
go version go1.10.3 linux/amd64 (through yocto/sumo)

Happy to try newer go versions if someone thinks this might have changed. Afaics it's been like this for several go minor versions at least.

$ arm-oe-linux-gnueabi-go install -x -p 4 -v -ldflags="-r /usr/lib/go/pkg/linux_arm_dynlink -X k8s.io/kubernetes/pkg/version.buildDate=2019-03-20T10:56:18Z -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.buildDate=2019-03-20T10:56:18Z -X k8s.io/kubernetes/pkg/version.gitCommit=1bfeeb6f212135a22dc787b73e1980e5bccef13d -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitCommit=1bfeeb6f212135a22dc787b73e1980e5bccef13d -X k8s.io/kubernetes/pkg/version.gitTreeState=archive -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitTreeState=archive -X k8s.io/kubernetes/pkg/version.gitVersion=v1.9.11 -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitVersion=v1.9.11 -X k8s.io/kubernetes/pkg/version.gitMajor=1 -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMajor=1 -X k8s.io/kubernetes/pkg/version.gitMinor=9 -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMinor=9" k8s.io/kubernetes/cmd/kube-proxy k8s.io/kubernetes/cmd/kube-apiserver k8s.io/kubernetes/cmd/kube-controller-manager k8s.io/kubernetes/cmd/cloud-controller-manager k8s.io/kubernetes/cmd/kubelet k8s.io/kubernetes/cmd/kubeadm k8s.io/kubernetes/cmd/hyperkube k8s.io/kubernetes/plugin/cmd/kube-scheduler k8s.io/kubernetes/cluster/gce/gci/mounter k8s.io/kubernetes/cmd/kubectl 
 
WORK=/tmp/go-build165979831
k8s.io/kubernetes/cmd/kube-apiserver
mkdir -p $WORK/k8s.io/kubernetes/cmd/kube-apiserver/_obj/
mkdir -p $WORK/k8s.io/kubernetes/cmd/kube-apiserver/_obj/exe/
cd /tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/build/src/k8s.io/kubernetes/cmd/kube-apiserver
/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/recipe-sysroot-native/usr/lib/arm-oe-linux-gnueabi/go/pkg/tool/linux_amd64/compile -o $WORK/k8s.io/kubernetes/cmd/kube-apiserver.a -trimpath $WORK -goversion go1.9.7 -p main -complete -buildid 9c846c3996a791a1dbf188306040206b61119f6a -importmap github.com/spf13/pflag=k8s.io/kubernetes/vendor/github.com/spf13/pflag -importmap k8s.io/apiserver/pkg/server=k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server -importmap k8s.io/apiserver/pkg/util/flag=k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/util/flag -importmap k8s.io/apiserver/pkg/util/logs=k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/util/logs -D _/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/build/src/k8s.io/kubernetes/cmd/kube-apiserver -I $WORK -I /tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/build/pkg/linux_arm -pack ./apiserver.go
cd .
/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/recipe-sysroot-native/usr/lib/arm-oe-linux-gnueabi/go/pkg/tool/linux_amd64/link -o $WORK/k8s.io/kubernetes/cmd/kube-apiserver/_obj/exe/a.out -L $WORK -L /tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/build/pkg/linux_arm -extld=arm-oe-linux-gnueabi-gcc "-extldflags=-march=armv7ve -marm -mfpu=neon -mfloat-abi=hard --sysroot=/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/recipe-sysroot" -buildmode=exe -buildid=9c846c3996a791a1dbf188306040206b61119f6a -r /usr/lib/go/pkg/linux_arm_dynlink -X k8s.io/kubernetes/pkg/version.buildDate=2019-03-20T10:56:18Z -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.buildDate=2019-03-20T10:56:18Z -X k8s.io/kubernetes/pkg/version.gitCommit=1bfeeb6f212135a22dc787b73e1980e5bccef13d -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitCommit=1bfeeb6f212135a22dc787b73e1980e5bccef13d -X k8s.io/kubernetes/pkg/version.gitTreeState=archive -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitTreeState=archive -X k8s.io/kubernetes/pkg/version.gitVersion=v1.9.11 -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitVersion=v1.9.11 -X k8s.io/kubernetes/pkg/version.gitMajor=1 -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMajor=1 -X k8s.io/kubernetes/pkg/version.gitMinor=9 -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMinor=9 $WORK/k8s.io/kubernetes/cmd/kube-apiserver.a
# k8s.io/kubernetes/cmd/kube-apiserver
net(.text): direct call too far: .plt 873e4e
net(.text): direct call too far: .plt 873e46
net(.text): direct call too far: .plt 873e41
net(.text): direct call too far: .plt 873e37
net(.text): direct call too far: .plt 873e1f
net(.text): direct call too far: .plt 873e10
net(.text): direct call too far: .plt 873e0e
net(.text): direct call too far: .plt 873e07
net(.text): direct call too far: .plt 873e08
net(.text): direct call too far: .plt 873e05
net(.text): direct call too far: .plt 873ded
runtime/cgo(.text): direct call too far: .plt 873dd9
runtime/cgo(.text): direct call too far: .plt 873dd6
runtime/cgo(.text): direct call too far: .plt 873dd6
runtime/cgo(.text): direct call too far: .plt 873dd8
runtime/cgo(.text): direct call too far: .plt 873dd2
runtime/cgo(.text): direct call too far: .plt 873dce
runtime/cgo(.text): direct call too far: .plt 873dca
runtime/cgo(.text): direct call too far: .plt 873db2
runtime/cgo(.text): direct call too far: .plt 873db7
runtime/cgo(.text): direct call too far: .plt 873db1
/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/recipe-sysroot-native/usr/lib/arm-oe-linux-gnueabi/go/pkg/tool/linux_amd64/link: too many errors
go env
GOARCH="arm"
GOBIN=""
GOCACHE="off"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/build"
GORACE=""
GOROOT="/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/recipe-sysroot-native/usr/lib/go"
GOTMPDIR="/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/go-tmp"
GOTOOLDIR="/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/recipe-sysroot-native/usr/lib/arm-oe-linux-gnueabi/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
GOARM="5"
CC="arm-oe-linux-gnueabi-gcc -march=armv7ve -marm -mfpu=neon -mfloat-abi=hard --sysroot=/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/recipe-sysroot"
CXX="arm-oe-linux-gnueabi-g++ -march=armv7ve -marm -mfpu=neon -mfloat-abi=hard --sysroot=/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/recipe-sysroot"
CGO_ENABLED="1"
CGO_CFLAGS="-O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0=/usr/src/debug/kubernetes/1.9.11-r0 -fdebug-prefix-map=/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/recipe-sysroot= -fdebug-prefix-map=/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/recipe-sysroot-native="
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0=/usr/src/debug/kubernetes/1.9.11-r0 -fdebug-prefix-map=/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/recipe-sysroot= -fdebug-prefix-map=/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/recipe-sysroot-native= -fvisibility-inlines-hidden"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-march=armv7ve -marm -mfpu=neon -mfloat-abi=hard --sysroot=/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/recipe-sysroot -fPIC -marm -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/go-tmp/go-build451264647=/tmp/go-build -gno-record-gcc-switches"

Works with external linker:

arm-oe-linux-gnueabi-go install -x -p 4 -v -ldflags="--linkmode=external -r /usr/lib/go/pkg/linux_arm_dynlink -X k8s.io/kubernetes/pkg/version.buildDate=2019-03-20T10:56:18Z -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.buildDate=2019-03-20T10:56:18Z -X k8s.io/kubernetes/pkg/version.gitCommit=1bfeeb6f212135a22dc787b73e1980e5bccef13d -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitCommit=1bfeeb6f212135a22dc787b73e1980e5bccef13d -X k8s.io/kubernetes/pkg/version.gitTreeState=archive -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitTreeState=archive -X k8s.io/kubernetes/pkg/version.gitVersion=v1.9.11 -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitVersion=v1.9.11 -X k8s.io/kubernetes/pkg/version.gitMajor=1 -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMajor=1 -X k8s.io/kubernetes/pkg/version.gitMinor=9 -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMinor=9" k8s.io/kubernetes/cmd/kube-proxy k8s.io/kubernetes/cmd/kube-apiserver k8s.io/kubernetes/cmd/kube-controller-manager k8s.io/kubernetes/cmd/cloud-controller-manager k8s.io/kubernetes/cmd/kubelet k8s.io/kubernetes/cmd/kubeadm k8s.io/kubernetes/cmd/hyperkube k8s.io/kubernetes/plugin/cmd/kube-scheduler k8s.io/kubernetes/cluster/gce/gci/mounter k8s.io/kubernetes/cmd/kubectl

WORK=/tmp/go-build984636367
k8s.io/kubernetes/cmd/kube-apiserver
mkdir -p $WORK/k8s.io/kubernetes/cmd/kube-apiserver/_obj/
mkdir -p $WORK/k8s.io/kubernetes/cmd/kube-apiserver/_obj/exe/
cd /tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/build/src/k8s.io/kubernetes/cmd/kube-apiserver
/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/recipe-sysroot-native/usr/lib/arm-oe-linux-gnueabi/go/pkg/tool/linux_amd64/compile -o $WORK/k8s.io/kubernetes/cmd/kube-apiserver.a -trimpath $WORK -goversion go1.9.7 -p main -complete -buildid 9c846c3996a791a1dbf188306040206b61119f6a -importmap github.com/spf13/pflag=k8s.io/kubernetes/vendor/github.com/spf13/pflag -importmap k8s.io/apiserver/pkg/server=k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server -importmap k8s.io/apiserver/pkg/util/flag=k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/util/flag -importmap k8s.io/apiserver/pkg/util/logs=k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/util/logs -D _/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/build/src/k8s.io/kubernetes/cmd/kube-apiserver -I $WORK -I /tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/build/pkg/linux_arm -pack ./apiserver.go
cd .
/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/recipe-sysroot-native/usr/lib/arm-oe-linux-gnueabi/go/pkg/tool/linux_amd64/link -o $WORK/k8s.io/kubernetes/cmd/kube-apiserver/_obj/exe/a.out -L $WORK -L /tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/build/pkg/linux_arm -extld=arm-oe-linux-gnueabi-gcc "-extldflags=-march=armv7ve -marm -mfpu=neon -mfloat-abi=hard --sysroot=/tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/recipe-sysroot" -buildmode=exe -buildid=9c846c3996a791a1dbf188306040206b61119f6a --linkmode=external -r /usr/lib/go/pkg/linux_arm_dynlink -X k8s.io/kubernetes/pkg/version.buildDate=2019-03-20T10:56:18Z -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.buildDate=2019-03-20T10:56:18Z -X k8s.io/kubernetes/pkg/version.gitCommit=1bfeeb6f212135a22dc787b73e1980e5bccef13d -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitCommit=1bfeeb6f212135a22dc787b73e1980e5bccef13d -X k8s.io/kubernetes/pkg/version.gitTreeState=archive -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitTreeState=archive -X k8s.io/kubernetes/pkg/version.gitVersion=v1.9.11 -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitVersion=v1.9.11 -X k8s.io/kubernetes/pkg/version.gitMajor=1 -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMajor=1 -X k8s.io/kubernetes/pkg/version.gitMinor=9 -X k8s.io/kubernetes/vendor/k8s.io/client-go/pkg/version.gitMinor=9 $WORK/k8s.io/kubernetes/cmd/kube-apiserver.a
mkdir -p /tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/build/bin/linux_arm/
mv $WORK/k8s.io/kubernetes/cmd/kube-apiserver/_obj/exe/a.out /tmp/oe-tmp-glibc/work/armv7vehf-neon-oe-linux-gnueabi/kubernetes/1.9.11-r0/build/bin/linux_arm/kube-apiserver

See also #19425

@anguslees anguslees changed the title @anguslees Please open a new issue with more details and cc me. arm: net(.text): direct call too far: .plt 873e4e Mar 20, 2019

@anguslees

This comment has been minimized.

Copy link
Author

commented Mar 20, 2019

cc @luxas

@ianlancetaylor ianlancetaylor changed the title arm: net(.text): direct call too far: .plt 873e4e cmd/link: arm: net(.text): direct call too far: .plt 873e4e Mar 20, 2019

@ianlancetaylor ianlancetaylor added this to the Go1.13 milestone Mar 20, 2019

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Mar 20, 2019

CC @cherrymui

Note that this bug report is against 1.10.3.

@cherrymui

This comment has been minimized.

Copy link
Contributor

commented Mar 20, 2019

Yeah, it looks like this is the same problem as #19425, which is for PPC64. Maybe we should apply the same change to ARM. I'll take a look. Thanks.

@cherrymui

This comment has been minimized.

Copy link
Contributor

commented Mar 22, 2019

I can reproduce this with Go tip and kubernetes tip. Internal linking fails, external linking works.

This is a little different from the PPC64 case. On ARM (pretty much most of the non-PPC64 platforms), the PLT relocations are created later, after the trampoline insertion pass. Also, we don't know the address of the .plt section until pretty late. Maybe we could layout .plt along with .text? Then the trampoline pass would do the right thing. I'll see if we could make that work.

anguslees added a commit to containos/meta-containos that referenced this issue Mar 28, 2019

@andybons andybons modified the milestones: Go1.13, Go1.14 Jul 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.