cmd/go: "#cgo pkg-config:" comments do not work with gccgo

Bug #1475533 reported by Matthias Klose
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc
Unknown
Unknown
gcc-5 (Ubuntu)
Fix Released
High
Michael Hudson-Doyle
Matthias Klose (doko)
Changed in gcc-5 (Ubuntu):
importance: Undecided → High
status: New → Triaged
Revision history for this message
Matthias Klose (doko) wrote :

as long as this is not yet implemented, you can work around this by:

DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

ifneq (,$(filter $(DEB_HOST_ARCH), powerpc s390x))
  pkg_configs = dbus-1 libnih libnih-dbus glib-2.0 gobject-2.0 ... and more
  export CGO_CFLAGS := \
    $(shell $(foreach pkg, $(pkg_configs), pkg-config --cflags $(pkg); ))
  export CGO_CXXFLAGS := $(CGO_CFLAGS)
  export CGO_LDFLAGS := \
    $(shell $(foreach pkg, $(pkg_configs), pkg-config --libs $(pkg); ))
  $(warning setting CGO_CFLAGS = $(CGO_CFLAGS))
  $(warning setting CGO_CXXFLAGS = $(CGO_CXXFLAGS))
  $(warning setting CGO_LDFLAGS = $(CGO_LDFLAGS))
endif

Changed in gcc-5 (Ubuntu):
assignee: nobody → Michael Hudson-Doyle (mwhudson)
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I've proposed a fix at https://go-review.googlesource.com/18790. Assuming Ian doesn't hate the sight of it, it would be good to chuck it in as a distro patch for gccgo 5 and test it out on some of those packages that don't build with gccgo.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :
Revision history for this message
Matthias Klose (doko) wrote :

ftbfs in GCC trunk

../../src/gotools/../libgo/go/cmd/go/build.go:2563:7: error: reference to undefined name 'err'
if err != nil {
^

Makefile:671: recipe for target 'go' failed
make[4]: *** [go] Error 1
make[4]: Leaving directory '/scratch/packages/gcc/6/gcc-6-6-20160122/build/gotools'
Makefile:12918: recipe for target 'all-gotools' failed
make[3]: *** [all-gotools] Error 2

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Sorry about that. Try this one instead http://paste.ubuntu.com/14691833/

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Argh even that one isn't quite right.

Patch for gcc 5: //paste.ubuntu.com/14692803/ (built and tested)
Patch for gcc master: //paste.ubuntu.com/14692814/ (not built in a gcc tree, but it's the same patch as //paste.ubuntu.com/14692814/ which I have tested)

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Er let's try that again.

Patch for gcc 5: http://paste.ubuntu.com/14692803
Patch for gcc master: http://paste.ubuntu.com/14692814 (which is the same patch as https://go-review.googlesource.com/#/c/18790/4)

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Third time's a charm. *this* is the patch for gcc master: http://paste.ubuntu.com/14692846/

Revision history for this message
Matthias Klose (doko) wrote :

fixed for xenial

Changed in gcc-5 (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.