From ccbcefe2b63382eb7771de9054cb5eb774d8dac8 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Wed, 13 Jan 2010 14:39:16 +1100 Subject: 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 --- src/cmd/ld/lib.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/cmd/ld/lib.c') diff --git a/src/cmd/ld/lib.c b/src/cmd/ld/lib.c index 232916845e..f702bae237 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"; } -- cgit v1.3-5-g9baa