From 5f9fb1ce0293c3d5bc2b0fd81ad7e0aaafd414f0 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 2 Nov 2016 23:22:18 -0400 Subject: [PATCH] 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 TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/go/build.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go index 8c438f6f6f..4427a06ce5 100644 --- a/src/cmd/go/build.go +++ b/src/cmd/go/build.go @@ -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 -- 2.48.1