cmd/go: rebuild stale shared objects before linking against them.

This changes the action graph when shared libraries are involved to always have
an action for the shared library (which does nothing when the shared library
is up to date).

Change-Id: Ibbc70fd01cbb3f4e8c0ef96e62a151002d446144
Reviewed-on: https://go-review.googlesource.com/8934
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Michael Hudson-Doyle 2015-04-14 12:03:21 +02:00 committed by Ian Lance Taylor
parent 21cb062540
commit a1858e9cf0
9 changed files with 315 additions and 53 deletions

View file

@ -516,14 +516,8 @@ func loadlib() {
if Ctxt.Library[i].Shlib != "" {
ldshlibsyms(Ctxt.Library[i].Shlib)
} else {
// Because the linker always looks for runtime/cgo when
// -buildmode=shared is passed, the go tool never passes
// runtime/cgo on the command line. But runtime/cgo needs
// to end up in the package list if it is being built into
// the shared libarary.
if Buildmode == BuildmodeShared {
pkglistfornote = append(pkglistfornote, "runtime/cgo"...)
pkglistfornote = append(pkglistfornote, '\n')
if DynlinkingGo() {
Exitf("cannot implicitly include runtime/cgo in a shared library")
}
objfile(Ctxt.Library[i].File, Ctxt.Library[i].Pkg)
}