1 diff -u -r ../go/src/cmd/go/build.go ./src/cmd/go/build.go
2 --- ../go/src/cmd/go/build.go 2016-08-15 18:47:58.000000000 -0400
3 +++ ./src/cmd/go/build.go 2016-08-18 18:05:18.471655968 -0400
5 ldflags = append(ldflags, "-Wl,-r", "-nostdlib", "-Wl,--whole-archive", "-lgolibbegin", "-Wl,--no-whole-archive")
7 if b.gccSupportsNoPie() {
8 - ldflags = append(ldflags, "-no-pie")
9 + ldflags = append(ldflags, "-nopie")
12 // We are creating an object file, so we don't want a build ID.
17 - if strings.Contains(a[0], "clang") {
18 + if runtime.GOOS == "android" {
19 // disable ASCII art in clang errors, if possible
20 a = append(a, "-fno-caret-diagnostics")
21 // clang is too smart about command-line arguments
23 // -no-pie must be passed when doing a partial link with -Wl,-r. But -no-pie is
24 // not supported by all compilers.
25 func (b *builder) gccSupportsNoPie() bool {
26 - return b.gccSupportsFlag("-no-pie")
27 + return b.gccSupportsFlag("-nopie")
30 // gccSupportsFlag checks to see if the compiler supports a flag.
32 ldflags := stringList(bareLDFLAGS, "-Wl,-r", "-nostdlib", staticLibs)
34 if b.gccSupportsNoPie() {
35 - ldflags = append(ldflags, "-no-pie")
36 + ldflags = append(ldflags, "-nopie")
39 // We are creating an object file, so we don't want a build ID.