From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2116) id 92B0A3857363; Tue, 28 Jun 2022 17:20:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 92B0A3857363 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Ian Lance Taylor To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-1332] libgo: make runtime.Version return a meaningful string X-Act-Checkin: gcc X-Git-Author: Ian Lance Taylor X-Git-Refname: refs/heads/master X-Git-Oldrev: ad4c44d20ece1fbfb9aced1fbcdab8928d702c73 X-Git-Newrev: 53c4ef1e3cc103ce5bdf1d9923144e93b523102a Message-Id: <20220628172010.92B0A3857363@sourceware.org> Date: Tue, 28 Jun 2022 17:20:10 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2022 17:20:10 -0000 https://gcc.gnu.org/g:53c4ef1e3cc103ce5bdf1d9923144e93b523102a commit r13-1332-g53c4ef1e3cc103ce5bdf1d9923144e93b523102a Author: Ian Lance Taylor Date: Mon Jun 27 17:22:53 2022 -0700 libgo: make runtime.Version return a meaningful string Fixes golang/go#51850 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/414734 Diff: --- gcc/go/gofrontend/MERGE | 2 +- libgo/Makefile.am | 1 + libgo/Makefile.in | 1 + libgo/go/runtime/extern.go | 10 ---------- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index a0e386ab4f6..551ea650acf 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -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. diff --git a/libgo/Makefile.am b/libgo/Makefile.am index a5d4b6a3525..b03e6553e90 100644 --- a/libgo/Makefile.am +++ b/libgo/Makefile.am @@ -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) $@ diff --git a/libgo/Makefile.in b/libgo/Makefile.in index 22f48a52938..16ed62a82ed 100644 --- a/libgo/Makefile.in +++ b/libgo/Makefile.in @@ -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) $@ diff --git a/libgo/go/runtime/extern.go b/libgo/go/runtime/extern.go index a371d9c0ee0..8e226147965 100644 --- a/libgo/go/runtime/extern.go +++ b/libgo/go/runtime/extern.go @@ -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:". -// -// This is set by the linker. -// -// This is accessed by "go version ". -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".