Commit 88ba4de1 authored by Shenghou Ma's avatar Shenghou Ma

cmd/5l: embed $GOARM value into binary as runtime.goarm

R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/6449127
parent 5b7562dd
...@@ -307,6 +307,7 @@ EXTERN Prog zprg; ...@@ -307,6 +307,7 @@ EXTERN Prog zprg;
EXTERN int dtype; EXTERN int dtype;
EXTERN int tlsoffset; EXTERN int tlsoffset;
EXTERN int armsize; EXTERN int armsize;
EXTERN int goarm;
extern char* anames[]; extern char* anames[];
extern Optab optab[]; extern Optab optab[];
......
...@@ -76,6 +76,7 @@ main(int argc, char *argv[]) ...@@ -76,6 +76,7 @@ main(int argc, char *argv[])
{ {
int c; int c;
char *p, *name, *val; char *p, *name, *val;
Sym *s;
Binit(&bso, 1, OWRITE); Binit(&bso, 1, OWRITE);
listinit(); listinit();
...@@ -89,7 +90,11 @@ main(int argc, char *argv[]) ...@@ -89,7 +90,11 @@ main(int argc, char *argv[])
nuxiinit(); nuxiinit();
p = getenv("GOARM"); 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; debug['F'] = 1;
ARGBEGIN { ARGBEGIN {
...@@ -243,6 +248,11 @@ main(int argc, char *argv[]) ...@@ -243,6 +248,11 @@ main(int argc, char *argv[])
cbp = buf.cbuf; cbp = buf.cbuf;
cbc = sizeof(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"); addlibpath("command line", "command line", argv[0], "main");
loadlib(); loadlib();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment