[Bug c++/71111] New: gcc5 (v5.3.1) - _moddi3: .... error adding symbols: Bad value

2016-05-13 Thread matthew at giassa dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7

Bug ID: 7
   Summary: gcc5 (v5.3.1) - _moddi3:  error adding symbols:
Bad value
   Product: gcc
   Version: 5.3.1
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: matthew at giassa dot net
CC: matthew at giassa dot net
  Target Milestone: ---
  Host: 4.4.0-21-generic Ubuntu SMP i686 GNU/Linux
Target: (Same as host, x86)

I have a simple project that does some number crunching in C++. The project is
built as a simple standalone shared library, libmx2.so.

There is a second library, libmx2gui.so, which is a Gtk "wrapper" for the
libmx2.so library, providing a means for Gtk apps to have dialogs which act as
the equivalent of the command-line functionality provided by the libmx2.so
library. The GUI library links dynamically against the other library at build
time.

Building on Ubuntu 14.04 LTS with GCCv4.8 worked fine, but after upgrading to
Ubuntu 16.04 LTS and GCCv5 (5.3.1), I get a bizarre error when linking the GUI
library:

__moddi3: invalid version 26897 (max 0)
./lib/libmx2.so: error adding symbols: Bad value

This issue only occurs on 32-bit machines, not on 64-bit machines. Enabling
verbose output via gcc -v provides no additional information. The linker flags
used by both libraries is:

# libmx
LDFLAGS = -Wl,--version-script=exports.map -fvisibility=hidden 
  -fvisibility-inlines-hidden -Wl,-z,defs,-soname,${LIB_OUT_NAME}

# libmx2gui
LDFLAGS = -Wl,-z,defs,-soname,${LIB_OUT_NAME}

Both libraries are linked against their object files via:

@${CXX} ${LDFLAGS} -shared -o ${OUTPUT_LIBRARY_NAME} ${OBJ} ${LIBS}

Where OBJ is a list of the object files, and LIBS is a list of libraries to
link against.

Is there any reason to suspect this is a bug in GCCv5, or is it a poor choice
of link/compiler settings for my libraries?

I've created some additional bare-bones libraries that simply use the API from
libmx2.so, and they too have the same error. My initial guess (an obvious one)
is there's either something wrong with how I'm building libmx2.so, or there's
something wrong with my linking options when having other shared objects link
against it. Still baffled why this only occurs on 32-bit GCC5.

[Bug c++/71111] gcc5 (v5.3.1) - _moddi3: .... error adding symbols: Bad value

2016-05-13 Thread matthew at giassa dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7

Matthew Giassa  changed:

   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 CC||hjl.tools at gmail dot com
 Resolution|MOVED   |---

--- Comment #2 from Matthew Giassa  ---
Updating CC (hopefully not erroneously) with a dev who was involved in
resolving a remotely similar bug (63784). Need to get some people on the CC
list.

[Bug c++/71111] gcc5 (v5.3.1) - _moddi3: .... error adding symbols: Bad value

2016-05-13 Thread matthew at giassa dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7

--- Comment #3 from Matthew Giassa  ---
(In reply to Andrew Pinski from comment #1)
> GCC does not provide the linker or load.
> 
> You should report this to Ubuntu.

Will do. Thanks!

Is there a trivial way to drop-in a different `ld' tool temporarily, for
before-and-after testing on the same system?