[patch, committed, ia64-hp-hpux*] Fix -flto failures

Steve Ellcey sje@cup.hp.com
Thu Mar 3 18:56:00 GMT 2011


This patch fixes g++.dg/lto/20091022-2, g++.dg/torture/pr33572.C, and
g++.dg/torture/pr39417.C on IA64 HP-UX when compiled with -flto.

In this case the tests generate references to __gcc_personality_v0 which
is not defined in libgcc_s.so on HP-UX.  This patch fixes the problem by
including the __gcc_personality_v0 function in libgcc.

Tested on IA64 HP-UX and checked in.

FYI: I have done some more investigation into why the gcc.dg/cleanup-*
tests fail on ia64-hp-hpux* platforms when using the system unwind library
and the problem does not look like it is related to _UA_END_OF_STACK,
instead when we call _Unwind_ForcedUnwind it trys to get the personality
function and gets a NULL.  In HP-UX it tries to do a call without checking
for a NULL personality function and aborts.  In GCC Unwind, we check
for the personality function being null and only call it when it is
not null.  I am not sure why the personality routine is null, the
assembly code generated for cleanup-5.c on HP-UX contains:

        .global __gcc_personality_v0#
        .type   __gcc_personality_v0#, @function
        .personality    __gcc_personality_v0#


Steve Ellcey
sje@cup.hp.com



2011-03-03  Steve Ellcey  <sje@cup.hp.com>

	* config/ia64/t-hpux: Add $(srcdir)/unwind-c.c to LIB2ADDEH


Index: config/ia64/t-hpux
===================================================================
--- config/ia64/t-hpux	(revision 170637)
+++ config/ia64/t-hpux	(working copy)
@@ -50,7 +50,7 @@
 
 T_CFLAGS += -DUSE_LIBUNWIND_EXCEPTIONS
 
-LIB2ADDEH =
+LIB2ADDEH = $(srcdir)/unwind-c.c
 
 SHLIB_EXT = .so
 # Must include -lunwind in the link, so that libgcc_s.so has the necessary



More information about the Gcc-patches mailing list