mirror of
https://github.com/golang/go
synced 2024-11-22 03:24:41 -07:00
cmd/5l: embed $GOARM value into binary as runtime.goarm
R=golang-dev, dave, rsc CC=golang-dev https://golang.org/cl/6449127
This commit is contained in:
parent
5b7562dd6f
commit
88ba4de152
@ -307,6 +307,7 @@ EXTERN Prog zprg;
|
||||
EXTERN int dtype;
|
||||
EXTERN int tlsoffset;
|
||||
EXTERN int armsize;
|
||||
EXTERN int goarm;
|
||||
|
||||
extern char* anames[];
|
||||
extern Optab optab[];
|
||||
|
@ -76,6 +76,7 @@ main(int argc, char *argv[])
|
||||
{
|
||||
int c;
|
||||
char *p, *name, *val;
|
||||
Sym *s;
|
||||
|
||||
Binit(&bso, 1, OWRITE);
|
||||
listinit();
|
||||
@ -89,7 +90,11 @@ main(int argc, char *argv[])
|
||||
nuxiinit();
|
||||
|
||||
p = getenv("GOARM");
|
||||
if(p != nil && strcmp(p, "5") == 0)
|
||||
if(p != nil)
|
||||
goarm = atoi(p);
|
||||
else
|
||||
goarm = 7;
|
||||
if(goarm == 5)
|
||||
debug['F'] = 1;
|
||||
|
||||
ARGBEGIN {
|
||||
@ -243,6 +248,11 @@ main(int argc, char *argv[])
|
||||
cbp = buf.cbuf;
|
||||
cbc = sizeof(buf.cbuf);
|
||||
|
||||
// embed goarm to runtime.goarm
|
||||
s = lookup("runtime.goarm", 0);
|
||||
s->dupok = 1;
|
||||
adduint8(s, goarm);
|
||||
|
||||
addlibpath("command line", "command line", argv[0], "main");
|
||||
loadlib();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user