Commit e509bbc9 authored by Dave Cheney's avatar Dave Cheney

cmd/6a: add support for nacl/amd64p32

Replaces CL 70000043.

Switch to the amd64p32 linker model if we are building under nacl/amd64p32.

No need to introduce linkarchinit() as 6a contains its own main() function.

LGTM=rsc
R=rsc, minux.ma
CC=golang-codereviews
https://golang.org/cl/72020043
parent e31a1ce1
......@@ -63,6 +63,8 @@ Lconv(Fmt *fp)
return linklinefmt(ctxt, fp);
}
LinkArch* thelinkarch = &linkamd64;
void
main(int argc, char *argv[])
{
......@@ -72,18 +74,20 @@ main(int argc, char *argv[])
thechar = '6';
thestring = "amd64";
ctxt = linknew(&linkamd64);
ctxt->diag = yyerror;
ctxt->bso = &bstdout;
Binit(&bstdout, 1, OWRITE);
listinit6();
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);
if(strcmp(p, "amd64p32") == 0)
thelinkarch = &linkamd64p32;
ctxt = linknew(thelinkarch);
ctxt->diag = yyerror;
ctxt->bso = &bstdout;
Binit(&bstdout, 1, OWRITE);
listinit6();
fmtinstall('L', Lconv);
ensuresymb(NSYMB);
memset(debug, 0, sizeof(debug));
......
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