cmd/go: don't lose last flag from _cgo_flags
authorIan Lance Taylor <ian@gcc.gnu.org>
Mon, 5 Feb 2018 01:38:34 +0000 (01:38 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Mon, 5 Feb 2018 01:38:34 +0000 (01:38 +0000)
    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

From-SVN: r257373

gcc/go/gofrontend/MERGE
libgo/go/cmd/go/internal/work/gccgo.go

index 34d0e520fdffc784083c47a560af7571d74a7022..9cf3b14e31adaeb6efb54ef56a1cdfb0b2207511 100644 (file)
@@ -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.
index 8f5584607052b8779353825caa27cac5d1c468c2..72d4d9dd4ba1cb922be67a44e12bf74433acb54e 100644 (file)
@@ -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