]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: remove .o and .a files in builder.collect
authorRuss Cox <rsc@golang.org>
Thu, 3 Nov 2016 03:22:18 +0000 (23:22 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 3 Nov 2016 16:06:37 +0000 (16:06 +0000)
This matches the removal of .so files and makes the processing
of '-L/path/to -lfoo' and plain '/path/to/foo.a' match.

Fixes #16463.

Change-Id: I1464c5390d7eb6a3a33b4b2c951f87ef392ec94a
Reviewed-on: https://go-review.googlesource.com/32642
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/go/build.go

index 8c438f6f6f3317306610f311a691f8ae9a262d0c..4427a06ce5f6ae00ef80174152af573c41909f34 100644 (file)
@@ -3433,10 +3433,12 @@ func (b *builder) collect(p *Package, obj, ofile string, cgoLDFLAGS, outObj []st
                // skip "-framework X" on Darwin
                case goos == "darwin" && f == "-framework":
                        i++
-               // skip "*.{dylib,so,dll}"
+               // skip "*.{dylib,so,dll,o,a}"
                case strings.HasSuffix(f, ".dylib"),
                        strings.HasSuffix(f, ".so"),
-                       strings.HasSuffix(f, ".dll"):
+                       strings.HasSuffix(f, ".dll"),
+                       strings.HasSuffix(f, ".o"),
+                       strings.HasSuffix(f, ".a"):
                // Remove any -fsanitize=foo flags.
                // Otherwise the compiler driver thinks that we are doing final link
                // and links sanitizer runtime into the object file. But we are not doing