gccgo: -buildmode=shared and cgo don't work together

Bug #1586872 reported by Michael Hudson-Doyle
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-6 (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
New
Undecided
Unassigned

Bug Description

As seen at https://launchpad.net/~mwhudson/+archive/ubuntu/devirt/+build/9828197, this combination fails to build:

/usr/bin/gccgo-6 -o $WORK/libgithub.com-gosexy-gettext.so -shared -nostdlib -zdefs -Wl,--whole-archive /«PKGBUILDDIR»/obj-powerpc-linux-gnu/pkg/gccgo_linux_ppc_fPIC/github.com/gosexy/libgettext.a -Wl,--no-whole-archive -shared -nostdlib -lgo -lgcc_s -lgcc -lc -Wl,-soname=libgolang-github-gosexy-gettext.so.1 -Wl,-znow -fPIC
# /tmp/go-build671164651/libgithub.com-gosexy-gettext.so
/«PKGBUILDDIR»/obj-powerpc-linux-gnu/pkg/gccgo_linux_ppc_fPIC/github.com/gosexy/libgettext.a: member /«PKGBUILDDIR»/obj-powerpc-linux-gnu/pkg/gccgo_linux_ppc_fPIC/github.com/gosexy/libgettext.a(_cgo_flags) in archive is not an object
collect2: error: ld returned 1 exit status

I've reported this upstream (https://github.com/golang/go/issues/15885) and hacked up a fix which I'll attach in a moment.

Tags: patch
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :
description: updated
tags: added: patch
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Hmm, need to make a new version. Please don't do anything with this for now.

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

Here's a more comprehensive fix. Currently building in https://launchpad.net/~mwhudson/+archive/ubuntu/devirt/+packages, will test tomorrow.

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

The patch worked, so IMHO it's ready to upload.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-6 - 6.1.1-6ubuntu11

---------------
gcc-6 (6.1.1-6ubuntu11) yakkety; urgency=medium

  * Merge with Debian; remaining changes:
    - Build from upstream sources.

gcc-6 (6.1.1-6) unstable; urgency=medium

  * Update to SVN 20160609 (r237267, 6.1.1) from the gcc-6-branch.
    - Fix PR target/71389 (x86), PR tree-optimization/71259,
      PR target/70830 (ARM), PR target/67310 (x86), PR c++/71442,
      PR c++/70847, PR c++/71330, PR c++/71393, PR fortran/69659.
  * gdc: Fix linking the runtime library. Addresses: #826645.
  * Fix building libgnatprj on powerpc, and on PIE enabled builds (YunQiang Su).
    Closes: #826365.

 -- Matthias Klose <email address hidden> Thu, 09 Jun 2016 19:27:27 +0200

Changed in gcc-6 (Ubuntu):
status: New → 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.