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: run test in -linkshared mode failed #26582

Open
hengwu0 opened this issue Jul 25, 2018 · 7 comments

Comments

Projects
None yet
4 participants
@hengwu0
Copy link
Contributor

commented Jul 25, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version go1.10.3 linux/amd64

Does this issue reproduce with the latest release?

yes

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

Linux jim-PC 3.19.0-15-generic #15-Ubuntu SMP Thu Apr 16 23:32:37 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/jim/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/jim/go"
GORACE=""
GOROOT="/home/jim/golang/go"
GOTMPDIR=""
GOTOOLDIR="/home/jim/golang/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build891088383=/tmp/go-build -gno-record-gcc-switches"

What did you do?

1、 go install -buildmode=shared std
2、 go test -short -linkshared expvar

What did you expect to see?

expvar test PASS

What did you see instead?

failure details:
expvar (testmain)
main.statictmp_0: relocation target expvar.TestNil·f not defined
main.statictmp_0: relocation target expvar.TestInt·f not defined
main.statictmp_0: relocation target expvar.TestFloat·f not defined
main.statictmp_0: relocation target expvar.TestString·f not defined
main.statictmp_0: relocation target expvar.TestMapInit·f not defined
main.statictmp_0: relocation target expvar.TestMapCounter·f not defined
main.statictmp_0: relocation target expvar.TestFunc·f not defined
main.statictmp_0: relocation target expvar.TestHandler·f not defined
main.statictmp_1: relocation target expvar.BenchmarkIntAdd·f not defined
main.statictmp_1: relocation target expvar.BenchmarkIntSet·f not defined
main.statictmp_1: relocation target expvar.BenchmarkFloatAdd·f not defined
main.statictmp_1: relocation target expvar.BenchmarkFloatSet·f not defined
main.statictmp_1: relocation target expvar.BenchmarkStringSet·f not defined
main.statictmp_1: relocation target expvar.BenchmarkMapSet·f not defined
main.statictmp_1: relocation target expvar.BenchmarkMapSetDifferent·f not defined
main.statictmp_1: relocation target expvar.BenchmarkMapSetString·f not defined
main.statictmp_1: relocation target expvar.BenchmarkMapAddSame·f not defined
main.statictmp_1: relocation target expvar.BenchmarkMapAddDifferent·f not defined
main.statictmp_1: relocation target expvar.BenchmarkMapAddSameSteadyState·f not defined
main.statictmp_1: relocation target expvar.BenchmarkMapAddDifferentSteadyState·f not defined
main.statictmp_1: relocation target expvar.BenchmarkRealworldExpvarUsage·f not defined
/home/jim/golang/go/pkg/tool/linux_amd64/link: too many errors
FAIL expvar [build failed]

@hengwu0

This comment has been minimized.

Copy link
Contributor Author

commented Jul 25, 2018

Bug reason: The Shlib record of the pkg "expvar" should be cleaned once the expvar pkg being rebuilt. Otherwise, the "packageshlib" key word in importcfg.link file will render the "packagefile" ineffective, in which the "packagefile" indicate the path of _pkg_.a( or cached _pkg_.a) and the "packageshlib" indicate the path of it's shlib( antiquated path: pkg/linux_amd64_dynlink/libstd.so ).

@andybons

This comment has been minimized.

Copy link
Member

commented Jul 25, 2018

@andybons andybons added this to the Unplanned milestone Jul 25, 2018

@gopherbot

This comment has been minimized.

Copy link

commented Jul 26, 2018

Change https://golang.org/cl/125441 mentions this issue: cmd/link: clear up the Shlib record when building a pkg

@agnivade

This comment has been minimized.

Copy link
Member

commented Feb 28, 2019

@hengwu0 - I see you closed the PR. Is this still an issue for you ?

@hengwu0

This comment has been minimized.

Copy link
Contributor Author

commented Mar 1, 2019

@hengwu0 - I see you closed the PR. Is this still an issue for you ?

I tested this issue now again. It still can be reproduced with the golang1.11.5, and I don't know how to fix it.
I'm not using golang to link-shared or build-shared now, and i think it still needs much more time to grow.

@hengwu0

This comment has been minimized.

Copy link
Contributor Author

commented Mar 1, 2019

@hengwu0 - I see you closed the PR. Is this still an issue for you ?

I can close this issue if you want to.

@hengwu0 hengwu0 closed this Mar 1, 2019

@agnivade

This comment has been minimized.

Copy link
Member

commented Mar 1, 2019

We can reopen to put it up for investigation.

@agnivade agnivade reopened this Mar 1, 2019

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