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

mail settings
Submitter Steve Ellcey
Date March 3, 2011, 6:56 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/85326/
State New
Headers show


Steve Ellcey - March 3, 2011, 6:56 p.m.
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 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

2011-03-03  Steve Ellcey  <>

	* 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 @@ 
+LIB2ADDEH = $(srcdir)/unwind-c.c
 SHLIB_EXT = .so
 # Must include -lunwind in the link, so that has the necessary