From 9745eed4fd4160cfbf55e9dbbfa99aca5563b392 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 11 Jan 2018 18:22:23 -0800 Subject: cmd/go: make gccgo -buildmode=shared and -linkshared work again After CL 69831, addTransitiveLinkDeps ensures that all dependencies of a link appear in Deps. We no longer need to traverse through all actions to find them. And the old scheme of looking through all the actions and assuming we would see shared library actions before libraries they depend on no longer works. Now that we have complete deps, change to a simpler scheme in which we find the shared libraries in the deps, and then use that to sort the deps into archives and shared libraries. Fixes #22224 Change-Id: I14fcc773ac59b6f5c2965cc04d4ed962442cc89e Reviewed-on: https://go-review.googlesource.com/87497 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- misc/cgo/testshared/shared_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'misc/cgo/testshared/shared_test.go') diff --git a/misc/cgo/testshared/shared_test.go b/misc/cgo/testshared/shared_test.go index f1e8f0605b..cf049ec35b 100644 --- a/misc/cgo/testshared/shared_test.go +++ b/misc/cgo/testshared/shared_test.go @@ -351,10 +351,10 @@ func readNotes(f *elf.File) ([]*note, error) { func dynStrings(t *testing.T, path string, flag elf.DynTag) []string { f, err := elf.Open(path) - defer f.Close() if err != nil { t.Fatalf("elf.Open(%q) failed: %v", path, err) } + defer f.Close() dynstrings, err := f.DynString(flag) if err != nil { t.Fatalf("DynString(%s) failed on %s: %v", flag, path, err) @@ -598,7 +598,6 @@ func TestThreeGopathShlibs(t *testing.T) { // If gccgo is not available or not new enough call t.Skip. Otherwise, // return a build.Context that is set up for gccgo. func prepGccgo(t *testing.T) build.Context { - t.Skip("golang.org/issue/22472") gccgoName := os.Getenv("GCCGO") if gccgoName == "" { gccgoName = "gccgo" @@ -648,8 +647,6 @@ func TestGoPathShlibGccgo(t *testing.T) { // library with gccgo, another GOPATH package that depends on the first and an // executable that links the second library. func TestTwoGopathShlibsGccgo(t *testing.T) { - t.Skip("golang.org/issue/22224") - gccgoContext := prepGccgo(t) libgoRE := regexp.MustCompile("libgo.so.[0-9]+") -- cgit v1.3