mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 03:47:02 -05:00
libgo: make runtime.Version return a meaningful string
For golang/go#51850 Fixes PR go/106747 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/414734
This commit is contained in:
@@ -568,6 +568,7 @@ s-goroot: Makefile
|
||||
rm -f goroot.go.tmp
|
||||
echo "package runtime" > goroot.go.tmp
|
||||
echo 'var defaultGOROOT = `$(prefix)`' >> goroot.go.tmp
|
||||
echo 'var buildVersion = `'`cat $(srcdir)/VERSION | sed 1q`' '`$(GOC) --version | sed 1q`'`' >> goroot.go.tmp
|
||||
$(SHELL) $(srcdir)/mvifdiff.sh goroot.go.tmp goroot.go
|
||||
$(STAMP) $@
|
||||
|
||||
|
||||
@@ -2780,6 +2780,7 @@ s-goroot: Makefile
|
||||
rm -f goroot.go.tmp
|
||||
echo "package runtime" > goroot.go.tmp
|
||||
echo 'var defaultGOROOT = `$(prefix)`' >> goroot.go.tmp
|
||||
echo 'var buildVersion = `'`cat $(srcdir)/VERSION | sed 1q`' '`$(GOC) --version | sed 1q`'`' >> goroot.go.tmp
|
||||
$(SHELL) $(srcdir)/mvifdiff.sh goroot.go.tmp goroot.go
|
||||
$(STAMP) $@
|
||||
|
||||
|
||||
@@ -231,16 +231,6 @@ func GOROOT() string {
|
||||
return defaultGOROOT
|
||||
}
|
||||
|
||||
// buildVersion is the Go tree's version string at build time.
|
||||
//
|
||||
// If any GOEXPERIMENTs are set to non-default values, it will include
|
||||
// "X:<GOEXPERIMENT>".
|
||||
//
|
||||
// This is set by the linker.
|
||||
//
|
||||
// This is accessed by "go version <binary>".
|
||||
var buildVersion string
|
||||
|
||||
// Version returns the Go tree's version string.
|
||||
// It is either the commit hash and date at the time of the build or,
|
||||
// when possible, a release tag like "go1.3".
|
||||
|
||||
Reference in New Issue
Block a user