]> Cypherpunks repositories - gostls13.git/commitdiff
ignore $GOARCH inside the compiler and linker.
authorRob Pike <r@golang.org>
Wed, 13 Jan 2010 03:39:16 +0000 (14:39 +1100)
committerRob Pike <r@golang.org>
Wed, 13 Jan 2010 03:39:16 +0000 (14:39 +1100)
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/gc/lex.c
src/cmd/ld/lib.c
src/cmd/ld/lib.h

index 75d6d2200a2b95ecec5d980049ef407733f7742e..d74cb096ad65d5411733b614947608bbf5741d29 100644 (file)
@@ -225,7 +225,7 @@ findpkg(Strlit *name)
        if(goroot == nil) {
                goroot = getenv("GOROOT");
                goos = getenv("GOOS");
-               goarch = getenv("GOARCH");
+               goarch = thestring;
        }
 
        if(islocalname(name)) {
index 232916845e061dd971cf603ea1696aa61fc5b83e..f702bae237503fa47dea591888c0d43bff1d74d7 100644 (file)
@@ -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";
        }
index 4a300ac4e9022a4e2e91baa06837c9e910afb31a..bf26ae87d80d4847e8c682783702237cb52f3f62 100644 (file)
@@ -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);