From: Elias Naur Date: Tue, 30 Apr 2019 17:57:46 +0000 (+0200) Subject: cmd/dist: set the default external linker on platforms without gcc X-Git-Tag: go1.13beta1~479 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d7edc91643dbc76542930ee95ff66beea6eefa02;p=gostls13.git cmd/dist: set the default external linker on platforms without gcc The go tool already sets -extld to the appropriate compiler. This CL changes cmd/dist to do the same, to fix bootstrapping on platforms that only have clang (Android and iOS). Updates #31722 Change-Id: I8a4fd227f85a768053a8946198eab68bbbdf9ae5 Reviewed-on: https://go-review.googlesource.com/c/go/+/174305 Run-TryBot: Elias Naur Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go index e47f25dce6..560b19b680 100644 --- a/src/cmd/dist/build.go +++ b/src/cmd/dist/build.go @@ -666,6 +666,7 @@ func runInstall(dir string, ch chan struct{}) { if goldflags != "" { link = append(link, goldflags) } + link = append(link, "-extld="+compilerEnvLookup(defaultcc, goos, goarch)) link = append(link, "-o", pathf("%s/%s%s", tooldir, elem, exe)) targ = len(link) - 1 }