diff options
| author | Keith Randall <khr@golang.org> | 2014-07-21 20:52:11 -0700 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2014-07-21 20:52:11 -0700 |
| commit | 76f1b901dba2aa68c1e9e9a7e073287d4f293a53 (patch) | |
| tree | 151f28d33860ad4a13e49863b4ea80180b20b6b2 /src/pkg/runtime | |
| parent | d9079cc88346ea08ca65166447184513f0566d98 (diff) | |
| download | go-76f1b901dba2aa68c1e9e9a7e073287d4f293a53.tar.xz | |
runtime: keep build version around in binaries
So we can tell from a binary which version of
Go built it.
LGTM=minux, rsc
R=golang-codereviews, minux, khr, rsc, dave
CC=golang-codereviews
https://golang.org/cl/117040043
Diffstat (limited to 'src/pkg/runtime')
| -rw-r--r-- | src/pkg/runtime/proc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c index 21b036eaea..55c58442ba 100644 --- a/src/pkg/runtime/proc.c +++ b/src/pkg/runtime/proc.c @@ -129,6 +129,8 @@ static bool exitsyscallfast(void); static bool haveexperiment(int8*); static void allgadd(G*); +extern String runtime·buildVersion; + // The bootstrap sequence is: // // call osinit @@ -188,6 +190,13 @@ runtime·schedinit(void) runtime·copystack = false; mstats.enablegc = 1; + + if(runtime·buildVersion.str == nil) { + // Condition should never trigger. This code just serves + // to ensure runtime·buildVersion is kept in the resulting binary. + runtime·buildVersion.str = (uint8*)"unknown"; + runtime·buildVersion.len = 7; + } } extern void main·init(void); |
