summaryrefslogtreecommitdiff
path: root/src/cmd/8a/lex.c
diff options
context:
space:
mode:
authorDave Cheney <dave@cheney.net>2014-02-27 06:57:06 +1100
committerDave Cheney <dave@cheney.net>2014-02-27 06:57:06 +1100
commitda2fe8deff666387ed72dab99263740d3c83874f (patch)
treef65be635c5ae2188da4f351acc622af2644d60a3 /src/cmd/8a/lex.c
parentef581d5ddcf682eee798bf2ce0168dda5503a45e (diff)
downloadgo-da2fe8deff666387ed72dab99263740d3c83874f.tar.gz
cmd/5a, cmd/5c, cmd/6a, cmd/6c, cmd/8a, cmd/8c, cmd/cc: support for Native Client
From the original description in CL 15770043 The main change here is to consult $GOARCH. In 6c, when GOOS=nacl, some of the more complex addressing modes must be disabled, and the BP and R15 registers must not be used. See golang.org/s/go13nacl for design overview. LGTM=rsc R=golang-codereviews, gobot, rsc CC=golang-codereviews https://codereview.appspot.com/69020044
Diffstat (limited to 'src/cmd/8a/lex.c')
-rw-r--r--src/cmd/8a/lex.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cmd/8a/lex.c b/src/cmd/8a/lex.c
index b48b900b1..6c55b3143 100644
--- a/src/cmd/8a/lex.c
+++ b/src/cmd/8a/lex.c
@@ -79,6 +79,12 @@ main(int argc, char *argv[])
listinit8();
fmtinstall('L', Lconv);
+ // Allow GOARCH=thestring or GOARCH=thestringsuffix,
+ // but not other values.
+ p = getgoarch();
+ if(strncmp(p, thestring, strlen(thestring)) != 0)
+ sysfatal("cannot use %cc with GOARCH=%s", thechar, p);
+
ensuresymb(NSYMB);
memset(debug, 0, sizeof(debug));
cinit();
@@ -163,7 +169,7 @@ assemble(char *file)
errorexit();
}
Binit(&obuf, of, OWRITE);
- Bprint(&obuf, "go object %s %s %s\n", getgoos(), thestring, getgoversion());
+ Bprint(&obuf, "go object %s %s %s\n", getgoos(), getgoarch(), getgoversion());
Bprint(&obuf, "!\n");
for(pass = 1; pass <= 2; pass++) {