aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/ld
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-01-18 21:46:46 -0800
committerRuss Cox <rsc@golang.org>2010-01-18 21:46:46 -0800
commit4f8117d9eb680cf91107bdbbfea63b11edd5dba6 (patch)
treee3a92ec648aa8a2e9ef312c883cbe492b9c7710d /src/cmd/ld
parent539ff7b0c4d95871fbab49dff3a0b578345225d9 (diff)
downloadgo-4f8117d9eb680cf91107bdbbfea63b11edd5dba6.tar.xz
build: move GOOS, GOARCH, GOROOT lookup into central library.
bake default values in during build. R=r CC=golang-dev https://golang.org/cl/186173
Diffstat (limited to 'src/cmd/ld')
-rw-r--r--src/cmd/ld/lib.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/cmd/ld/lib.c b/src/cmd/ld/lib.c
index f702bae237..b70c874390 100644
--- a/src/cmd/ld/lib.c
+++ b/src/cmd/ld/lib.c
@@ -720,21 +720,9 @@ mywhatsys(void)
{
char *s;
- goroot = getenv("GOROOT");
- goos = getenv("GOOS");
-
- if(goroot == nil) {
- s = getenv("HOME");
- if(s == nil)
- s = "/home/ken";
- goroot = mal(strlen(s) + 10);
- strcpy(goroot, s);
- strcat(goroot, "/go");
- }
+ goroot = getgoroot();
+ goos = getgoos();
goarch = thestring; // ignore $GOARCH - we know who we are
- if(goos == nil) {
- goos = "linux";
- }
}
int