re PR go/66904 (cmd/go: "#cgo pkg-config:" comments do not work with gccgo)
authorIan Lance Taylor <ian@gcc.gnu.org>
Wed, 10 Feb 2016 18:30:27 +0000 (18:30 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 10 Feb 2016 18:30:27 +0000 (18:30 +0000)
commit931f434a72bdc01b58dfc88264e36abd86b19c3d
tree386d8d63867ca51e9229c2f90dff88b83421574f
parente03dd76578bb5e8b6d5ba2a2628d349bd5c822bf
re PR go/66904 (cmd/go: "#cgo pkg-config:" comments do not work with gccgo)

PR go/66904
    cmd/go: fix "#cgo pkg-config:" comments with gccgo

    Copy of https://golang.org/cl/18790 by Michael Hudson-Doyle.

    The unique difficulty of #cgo pkg-config is that the linker flags are recorded
    when the package is compiled but (obviously) must be used when the package is
    linked into an executable -- so the flags need to be stored on disk somewhere.
    As it happens cgo already writes out a _cgo_flags file: nothing uses it
    currently, but this change adds it to the lib$pkg.a file when compiling a
    package, reads it out when linking (and passes a version of the .a file with
    _cgo_flags stripped out of it to the linker). It's all fairly ugly but it works
    and I can't really think of any way of reducing the essential level of
    ugliness.

    Update golang/go#11739.
    GCC PR 66904.

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

From-SVN: r233290
gcc/go/gofrontend/MERGE
libgo/go/cmd/go/build.go