1
0
mirror of https://github.com/golang/go synced 2024-11-20 06:54:42 -07:00

cmd/go: remove .o and .a files in builder.collect

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>
This commit is contained in:
Russ Cox 2016-11-02 23:22:18 -04:00
parent 23e6e11245
commit 5f9fb1ce02

View 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