1
0
mirror of https://github.com/golang/go synced 2024-11-22 03:24:41 -07:00

ignore $GOARCH inside the compiler and linker.

by definition, they know what they are building for.
makes it easier to switch architectures when testing.

% 6g x.go
% 6l x.6
% 6.out
"Wed Jan 13 10:57:46 EST 2010"
% 8g x.go
% 8l x.8
% 8.out
"Wed Jan 13 10:57:46 EST 2010"
% echo $GOARCH

%

R=rsc
CC=golang-dev
https://golang.org/cl/186116
This commit is contained in:
Rob Pike 2010-01-13 14:39:16 +11:00
parent ea1a36efcd
commit ccbcefe2b6
3 changed files with 3 additions and 5 deletions

View File

@ -225,7 +225,7 @@ findpkg(Strlit *name)
if(goroot == nil) { if(goroot == nil) {
goroot = getenv("GOROOT"); goroot = getenv("GOROOT");
goos = getenv("GOOS"); goos = getenv("GOOS");
goarch = getenv("GOARCH"); goarch = thestring;
} }
if(islocalname(name)) { if(islocalname(name)) {

View File

@ -721,7 +721,6 @@ mywhatsys(void)
char *s; char *s;
goroot = getenv("GOROOT"); goroot = getenv("GOROOT");
goarch = getenv("GOARCH");
goos = getenv("GOOS"); goos = getenv("GOOS");
if(goroot == nil) { if(goroot == nil) {
@ -732,9 +731,7 @@ mywhatsys(void)
strcpy(goroot, s); strcpy(goroot, s);
strcat(goroot, "/go"); strcat(goroot, "/go");
} }
if(goarch == nil) { goarch = thestring; // ignore $GOARCH - we know who we are
goarch = "amd64";
}
if(goos == nil) { if(goos == nil) {
goos = "linux"; goos = "linux";
} }

View File

@ -52,6 +52,7 @@ EXTERN uchar inuxi4[4];
EXTERN uchar inuxi8[8]; EXTERN uchar inuxi8[8];
EXTERN char* outfile; EXTERN char* outfile;
EXTERN int32 nsymbol; EXTERN int32 nsymbol;
EXTERN char* thestring;
void addlib(char *src, char *obj); void addlib(char *src, char *obj);
void copyhistfrog(char *buf, int nbuf); void copyhistfrog(char *buf, int nbuf);