Commit 5f9fb1ce authored by Russ Cox's avatar Russ Cox

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: default avatarIan Lance Taylor <iant@golang.org>
parent 23e6e112
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment