diff --git a/src/cmd/gc/lex.c b/src/cmd/gc/lex.c index 75d6d2200a2..d74cb096ad6 100644 --- a/src/cmd/gc/lex.c +++ b/src/cmd/gc/lex.c @@ -225,7 +225,7 @@ findpkg(Strlit *name) if(goroot == nil) { goroot = getenv("GOROOT"); goos = getenv("GOOS"); - goarch = getenv("GOARCH"); + goarch = thestring; } if(islocalname(name)) { diff --git a/src/cmd/ld/lib.c b/src/cmd/ld/lib.c index 232916845e0..f702bae2375 100644 --- a/src/cmd/ld/lib.c +++ b/src/cmd/ld/lib.c @@ -721,7 +721,6 @@ mywhatsys(void) char *s; goroot = getenv("GOROOT"); - goarch = getenv("GOARCH"); goos = getenv("GOOS"); if(goroot == nil) { @@ -732,9 +731,7 @@ mywhatsys(void) strcpy(goroot, s); strcat(goroot, "/go"); } - if(goarch == nil) { - goarch = "amd64"; - } + goarch = thestring; // ignore $GOARCH - we know who we are if(goos == nil) { goos = "linux"; } diff --git a/src/cmd/ld/lib.h b/src/cmd/ld/lib.h index 4a300ac4e90..bf26ae87d80 100644 --- a/src/cmd/ld/lib.h +++ b/src/cmd/ld/lib.h @@ -52,6 +52,7 @@ EXTERN uchar inuxi4[4]; EXTERN uchar inuxi8[8]; EXTERN char* outfile; EXTERN int32 nsymbol; +EXTERN char* thestring; void addlib(char *src, char *obj); void copyhistfrog(char *buf, int nbuf);