[Bug target/59788] Mixing libc and libgcc_s unwinders on 64-bit Solaris 10+/x86 breaks EH

2014-02-04 Thread ro at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788

Rainer Orth  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Rainer Orth  ---
Fixed for 4.9.0.


[Bug target/59788] Mixing libc and libgcc_s unwinders on 64-bit Solaris 10+/x86 breaks EH

2014-02-04 Thread ro at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788

--- Comment #4 from Rainer Orth  ---
Author: ro
Date: Tue Feb  4 09:31:38 2014
New Revision: 207454

URL: http://gcc.gnu.org/viewcvs?rev=207454&root=gcc&view=rev
Log:
Ensure libgcc_s unwinder is always used on 64-bit Solaris 10+/x86 (PR
target/59788)

gcc:
PR target/59788
* config/sol2.h (LINK_LIBGCC_MAPFILE_SPEC): Define.
(LINK_SPEC): Use it for -shared, -shared-libgcc.

libgcc:
PR target/59788
* config/t-slibgcc-sld (libgcc-unwind.map): New target.
(install-libgcc-unwind-map-forbuild): New target.
(all): Depend on install-libgcc-unwind-map-forbuild.
(install-libgcc-unwind-map): New target.
(install): Depend on install-libgcc-unwind-map.

gcc/testsuite:
PR target/59788
* g++.dg/eh/unwind-direct.C: New test.

toplevel:
PR target/59788
* ltmain.sh (opt_duplicate_compiler_generated_deps): Enable on
*solaris2*.

Added:
trunk/gcc/testsuite/g++.dg/eh/unwind-direct.C
Modified:
trunk/ChangeLog
trunk/gcc/ChangeLog
trunk/gcc/config/sol2.h
trunk/gcc/testsuite/ChangeLog
trunk/libgcc/ChangeLog
trunk/libgcc/config/t-slibgcc-sld
trunk/ltmain.sh


[Bug target/59788] Mixing libc and libgcc_s unwinders on 64-bit Solaris 10+/x86 breaks EH

2014-01-17 Thread ro at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788

Rainer Orth  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
URL||http://gcc.gnu.org/ml/gcc-p
   ||atches/2014-01/msg01088.htm
   ||l

--- Comment #3 from Rainer Orth  ---
Patch submitted.


[Bug target/59788] Mixing libc and libgcc_s unwinders on 64-bit Solaris 10+/x86 breaks EH

2014-01-15 Thread ro at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788

--- Comment #2 from Rainer Orth  ---
Created attachment 31843
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31843&action=edit
initial patch

The attached initial patch works fine and fixes the testcase from the PR, but
is
unacceptable as is.

Initially, I attempted to force direct binding to the libgcc_s unwinder by
linking
with a special mapfile if linking with -lgcc_s.  This doesn't work since
libtool
builds shared libraries with -shared -nostdlib, adding -lgcc_s itself.

The second attempt (attached) instead uses that mapfile when -shared is passed.
When libtool adds -lgcc_s -lc -lgcc_s itself, it usually `optimizes' this into
-lc -lgcc_s.  When direct binding is in effect due to the mapfile, we achieve 
exactly what this patch intends to avoid, namely binding to the partial
unwinder
in amd64 libc.  This can be avoided by patching libtool to disable this
optimization
on *solaris2*, which this patch does.

While this works fine for the gcc runtime libraries, as can be observed with 
elfdump -y, gcc 4.9 cannot be released with this patch included: even if the
libtool (ltmain.sh actually) patch were accepted upstream, every package built
with libtool will contain an old copy without that change, causing the breakage
this patch is designed to avoid.  While the optimization can be avoided by
invoking libtool with --preserve-dup-deps, this seem unacceptable, as would
requiring users to run libtoolize from a hypothetical new libtool release with
the ltmain.sh patch.


[Bug target/59788] Mixing libc and libgcc_s unwinders on 64-bit Solaris 10+/x86 breaks EH

2014-01-13 Thread ro at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788

Rainer Orth  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-01-13
   Target Milestone|--- |4.9.0
 Ever confirmed|0   |1

--- Comment #1 from Rainer Orth  ---
Mine, patch in progress.