]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cmd/go: bring in final version of gccgo pkg-config support
authorIan Lance Taylor <ian@gcc.gnu.org>
Sat, 23 Apr 2016 00:41:03 +0000 (00:41 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Sat, 23 Apr 2016 00:41:03 +0000 (00:41 +0000)
    This updates gccgo to the final version of https://golang.org/cl/18790,
    by Michael Hudson-Doyle.

    Update golang/go#11739.

    Reviewed-on: https://go-review.googlesource.com/22400

From-SVN: r235380

gcc/go/gofrontend/MERGE
libgo/go/cmd/go/build.go

index ce20dad142f7dcbc8423b8d482da3662bdf9d485..5c8cd7d6f18d670c4f83c424192a489c636a89c2 100644 (file)
@@ -1,4 +1,4 @@
-ff29ea8e4e69eb94958aef4388da09a61b2b52b6
+97b358f525584e45fa2e3d83fc7d3a091900927a
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 4382cf72ed7f3346e9ab7db189410f5d76eabd17..d7a4a43093d226c3cd5b0fc065ff2524573c6153 100644 (file)
@@ -2647,9 +2647,18 @@ func (tools gccgoToolchain) ld(b *builder, root *action, out string, allactions
                if err != nil {
                        return err
                }
+               const ldflagsPrefix = "_CGO_LDFLAGS="
                for _, line := range strings.Split(string(flags), "\n") {
-                       if strings.HasPrefix(line, "_CGO_LDFLAGS=") {
-                               cgoldflags = append(cgoldflags, strings.Fields(line[13:])...)
+                       if strings.HasPrefix(line, ldflagsPrefix) {
+                               newFlags := strings.Fields(line[len(ldflagsPrefix):])
+                               for _, flag := range newFlags {
+                                       // Every _cgo_flags file has -g and -O2 in _CGO_LDFLAGS
+                                       // but they don't mean anything to the linker so filter
+                                       // them out.
+                                       if flag != "-g" && !strings.HasPrefix(flag, "-O") {
+                                               cgoldflags = append(cgoldflags, flag)
+                                       }
+                               }
                        }
                }
                return nil