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/go: build failure on amd64 Linux with an error in TestTwoGopathShlibsGccgo from CL 69831 onward #22224

Closed
siebenmann opened this issue Oct 12, 2017 · 7 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Milestone

Comments

@siebenmann
Copy link

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

The latest git tip I've tested this on is go version devel +926373ea79 Thu Oct 12 00:11:33 2017 +0000 linux/amd64.

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

GOARCH="amd64"
GOOS="linux"

Specifically I'm on Fedora 26. Since this test appears to use gccgo, it may be relevant that my reported (system) gccgo version is gccgo (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2).

What did you do?

Trying to do ./all.bash build now fails in TestTwoGopathShlibsGccgo:

[....]
##### ../misc/cgo/testcshared
PASS

##### ../misc/cgo/testshared
--- FAIL: TestTwoGopathShlibsGccgo (0.68s)
        shared_test.go:371: /tmpfs/testshared953842952/pkg/gccgo_linux_amd64_5577006791947779410_fPIC/shlibs/libdep2.so is not linked to anything matching libdepBase\.so
FAIL
exit status 1
FAIL    _/tmp/go/misc/cgo/testshared    13.913s
2017/10/11 20:36:31 Failed: exit status 1

##### ../misc/cgo/testplugin
PASS
something
[...]

Git bisection says that this started happening at commit 4e8be99, 'cmd/go: clean up compile vs link vs shared library actions'. I hacked in some instrumentation and it appears that libdep2.so here is only linked to libgo.so.11, libgcc_s.so.1, libc.so.6, and ld-linux-x86-64.so.2.

@ianlancetaylor ianlancetaylor added this to the Go1.10 milestone Oct 12, 2017
@ianlancetaylor ianlancetaylor added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 12, 2017
@ianlancetaylor
Copy link
Contributor

CC @rsc @mwhudson

@rsc
Copy link
Contributor

rsc commented Oct 12, 2017

Sorry about this. The test is being skipped on my Linux box because "gccgo too old". I will update my Linux distribution.

@rsc
Copy link
Contributor

rsc commented Oct 12, 2017

I have a new Linux and new gccgo and can reproduce the problem. Will fix, thanks.

@laboger
Copy link
Contributor

laboger commented Oct 18, 2017

This is failing on ppc64le as well, as long as your machine has gccgo and it is new enough.

I can see in the verbose output that the link for libdep2.so is different than before. I don't think this test is expecting libdepBase.a to be linked in.

/usr/bin/gccgo -o $WORK/b021/libdep2.so -Wl,-( -Wl,--whole-archive /tmp/testshared785817683/pkg/gccgo_linux_ppc64le_5577006791947779410_fPIC/libdep2.a /tmp/testshared785817683/pkg/gccgo_linux_ppc64le_5577006791947779410_fPIC/libdepBase.a -Wl,--no-whole-archive -Wl,-) -zdefs -shared -nostdlib -lgo -lgcc_s -lgcc -lc -fPIC

On Ubuntu 16.04 with gccgo 6, there is an additional failure.

--- FAIL: TestGoPathShlibGccgo (2.83s)
shared_test.go:371: ./bin/exe is not linked to anything matching libdepBase.so
--- FAIL: TestTwoGopathShlibsGccgo (1.10s)
shared_test.go:371: /tmp/testshared302107344/pkg/gccgo_linux_ppc64le_5577006791947779410_fPIC/shlibs/libdep2.so is not linked to anything matching libdepBase.so
shared_test.go:371: ./bin/exe2 is not linked to anything matching libdep2
shared_test.go:371: ./bin/exe2 is not linked to anything matching libdepBase.so
FAIL

@rsc
Copy link
Contributor

rsc commented Oct 19, 2017

Sorry, my fix for this was preempted by the point release work. If you want to add a skip to the test pointing at this issue, that's fine.

@gopherbot
Copy link

Change https://golang.org/cl/73851 mentions this issue: misc/cgo/testshared: disable TestTwoGopathShlibsGccgo

gopherbot pushed a commit that referenced this issue Oct 28, 2017
For #22224.

Change-Id: Iae873fddc72a79a96a32eaeb5d4dd885eaf810cb
Reviewed-on: https://go-review.googlesource.com/73851
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@ianlancetaylor ianlancetaylor changed the title cmd/go: build failure on amd64 Linux with an error in TestTwoGopathShlibsGccgo from commit 4e8be99590 onward cmd/go: build failure on amd64 Linux with an error in TestTwoGopathShlibsGccgo from CL 69831 onward Dec 6, 2017
@gopherbot
Copy link

Change https://golang.org/cl/87497 mentions this issue: cmd/go: make gccgo -buildmode=shared and -linkshared work again

@golang golang locked and limited conversation to collaborators Jan 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Projects
None yet
Development

No branches or pull requests

5 participants