]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: change Package.Shlib to be the absolute path of the shared library
authorMichael Hudson-Doyle <michael.hudson@canonical.com>
Mon, 18 May 2015 01:03:22 +0000 (13:03 +1200)
committerIan Lance Taylor <iant@golang.org>
Wed, 20 May 2015 14:52:36 +0000 (14:52 +0000)
Makes little difference internally but makes go list output more useful.

Change-Id: I1fa1f839107de08818427382b2aef8dc4d765b36
Reviewed-on: https://go-review.googlesource.com/10192
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>

src/cmd/go/build.go
src/cmd/go/pkg.go

index fda126b008d590929e15fc5c2fed0d51a19df588..738f748391e2b3937d09282851e4d2ce16eeb954 100644 (file)
@@ -782,8 +782,8 @@ func (b *builder) action1(mode buildMode, depMode buildMode, p *Package, looksha
                        b.actionCache[key] = a
                        return a
                }
-               pkgs := readpkglist(filepath.Join(p.build.PkgTargetRoot, shlib))
-               a = b.libaction(shlib, pkgs, modeInstall, depMode)
+               pkgs := readpkglist(shlib)
+               a = b.libaction(filepath.Base(shlib), pkgs, modeInstall, depMode)
                b.actionCache[key2] = a
                b.actionCache[key] = a
                return a
index 9466aad6a6152e6e0396a02a99de84f976c624fd..f9cf14fd2c89dbc185bc007ab497a26014d522ef 100644 (file)
@@ -536,7 +536,8 @@ func (p *Package) load(stk *importStack, bp *build.Package, err error) *Package
                        shlibnamefile := p.target[:len(p.target)-2] + ".shlibname"
                        shlib, err := ioutil.ReadFile(shlibnamefile)
                        if err == nil {
-                               p.Shlib = strings.TrimSpace(string(shlib))
+                               libname := strings.TrimSpace(string(shlib))
+                               p.Shlib = filepath.Join(p.build.PkgTargetRoot, libname)
                        } else if !os.IsNotExist(err) {
                                fatalf("unexpected error reading %s: %v", shlibnamefile, err)
                        }