Skip to content

Commit 7c7349c

Browse files
cmd/go: remove _cgo_flags from gccgo archive built using SWIG
Since SWIG uses cgo, when using SWIG with gccgo, the go tool will add a _cgo_flags file to the package archive, just as it does with cgo. We need to remove that file from the archive passed to the linker, just as we do with cgo. Change-Id: I5ef4fea92eec419f870fbf6f678691d15901ee6c Reviewed-on: https://go-review.googlesource.com/32535 Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Michael Hudson-Doyle <[email protected]>
1 parent 4e584c5 commit 7c7349c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cmd/go/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2797,7 +2797,7 @@ func (tools gccgoToolchain) link(b *builder, root *action, out string, allaction
27972797
if !apackagePathsSeen[a.p.ImportPath] {
27982798
apackagePathsSeen[a.p.ImportPath] = true
27992799
target := a.target
2800-
if len(a.p.CgoFiles) > 0 {
2800+
if len(a.p.CgoFiles) > 0 || a.p.usesSwig() {
28012801
target, err = readAndRemoveCgoFlags(target)
28022802
if err != nil {
28032803
return

0 commit comments

Comments
 (0)