From bfb87d5c0c901cdee614b0930ae7df63bbdc48ff Mon Sep 17 00:00:00 2001 From: ian Date: Mon, 5 Feb 2018 01:38:34 +0000 Subject: [PATCH] cmd/go: don't lose last flag from _cgo_flags The quoting code that read _cgo_flags, currently only in the gccgo version of cmd/go, was losing the last flag read from the file. Fixes golang/go#23666 Reviewed-on: https://go-review.googlesource.com/91655 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257373 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- libgo/go/cmd/go/internal/work/gccgo.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 34d0e520fdf..9cf3b14e31a 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -981e6621bcd48670d0b58e51e9eeffe549725378 +9057b8f71e6078f140938fe60be9aaa7d59a3a2b The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/go/cmd/go/internal/work/gccgo.go b/libgo/go/cmd/go/internal/work/gccgo.go index 8f558460705..72d4d9dd4ba 100644 --- a/libgo/go/cmd/go/internal/work/gccgo.go +++ b/libgo/go/cmd/go/internal/work/gccgo.go @@ -258,6 +258,9 @@ func (tools gccgoToolchain) link(b *Builder, root *Action, out, importcfg string nl = append(nl, b) start = false } + if len(nl) > 0 { + cgoldflags = append(cgoldflags, string(nl)) + } } } return nil -- 2.11.4.GIT