[Bug c++/64202] New: C linkage causes shared library exception address problem on ppc64 (not x86_64)

2014-12-05 Thread mjtruog at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64202

Bug ID: 64202
   Summary: C linkage causes shared library exception address
problem on ppc64 (not x86_64)
   Product: gcc
   Version: 4.8.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mjtruog at gmail dot com

Created attachment 34203
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34203&action=edit
Shared library interface with C linkage

This problem was found on the gcc test machine gcc112:
$ uname -a
Linux gcc2-power8.osuosl.org 3.15.10-201.fc20.ppc64p7 #1 SMP Sun Aug 31
13:31:49 MST 2014 ppc64 ppc64 ppc64 GNU/Linux
$ gcc -v -save-temps
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/ppc64-redhat-linux/4.8.3/lto-wrapper
Target: ppc64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin
--enable-initfini-array --enable-java-awt=gtk --disable-dssi
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib
--with-isl=/builddir/build/BUILD/gcc-4.8.3-20140624/obj-ppc64-redhat-linux/isl-install
--with-cloog=/builddir/build/BUILD/gcc-4.8.3-20140624/obj-ppc64-redhat-linux/cloog-install
--enable-secureplt --with-long-double-128 --build=ppc64-redhat-linux
Thread model: posix
gcc version 4.8.3 20140624 (Red Hat 4.8.3-1) (GCC)

The example to replicate the problem is attached.


[Bug c++/64202] C linkage causes shared library exception address problem on ppc64 (not x86_64)

2014-12-05 Thread mjtruog at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64202

--- Comment #2 from Michael Truog  ---
Created attachment 34205
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34205&action=edit
Main executable compiled as C


[Bug c++/64202] C linkage causes shared library exception address problem on ppc64 (not x86_64)

2014-12-05 Thread mjtruog at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64202

--- Comment #1 from Michael Truog  ---
Created attachment 34204
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34204&action=edit
shared library implementation compiled as C++


[Bug c++/64202] C linkage causes shared library exception address problem on ppc64 (not x86_64)

2014-12-05 Thread mjtruog at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64202

--- Comment #3 from Michael Truog  ---
The commands to compile the minimal example are:
g++ -O0 -g -c test_lib.cpp -o test_lib.o 
g++ -fPIC -DPIC -shared test_lib.o -o libtest.so.0.0.0
gcc -O0 -g -c -o test_main.o test_main.c
gcc -o test test_main.o libtest.so.0.0.0 -lstdc++ -Wl,-rpath -Wl,./


[Bug c++/64202] C linkage causes shared library exception address problem on ppc64 (not x86_64)

2014-12-05 Thread mjtruog at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64202

Michael Truog  changed:

   What|Removed |Added

 Resolution|INVALID |FIXED

--- Comment #7 from Michael Truog  ---
Thanks, that was it.


[Bug c++/64202] C linkage causes shared library exception address problem on ppc64 (not x86_64)

2014-12-05 Thread mjtruog at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64202

Michael Truog  changed:

   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|INVALID |---

--- Comment #5 from Michael Truog  ---
That does not resolve the problem.  I have tested it with -fPIC as you have
mentioned with the same result.  The compilation command lines I have provided
are minimal to represent what is being done in autoconf/automake/libtool with a
larger project, this is the minimal example based on that.