]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgo: make runtime.Version return a meaningful string
authorIan Lance Taylor <iant@golang.org>
Tue, 28 Jun 2022 00:22:53 +0000 (17:22 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 28 Jun 2022 17:19:58 +0000 (10:19 -0700)
Fixes golang/go#51850

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/414734

gcc/go/gofrontend/MERGE
libgo/Makefile.am
libgo/Makefile.in
libgo/go/runtime/extern.go

index a0e386ab4f64f43f926ccc0b79abc77e46015df8..551ea650acf7c52409023816243b8704b0605155 100644 (file)
@@ -1,4 +1,4 @@
-28fe9fad4acb4e02083faf5503b06e3e6e8eecaf
+d5b4abed2f206e492890acc20738e89617ea542c
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index a5d4b6a35251d3ed4edb7eb22e9eaefe9fbd7b7b..b03e6553e909d593ed6d768cce1ec06f1c057352 100644 (file)
@@ -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) $@
 
index 22f48a529383565b87c94acd0d8830168f923d07..16ed62a82edc709afc285f69c96846b3d0d078ae 100644 (file)
@@ -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) $@
 
index a371d9c0ee017aaf25bb24ec8dde61690f566435..8e2261479659ddc35faaf9b6f38086be9550984f 100644 (file)
@@ -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".