On Mon, Feb 28, 2011 at 7:22 PM, Steve Ellcey <s...@cup.hp.com> wrote:
> On Sat, 2011-02-26 at 18:45 +0100, Richard Guenther wrote:
>> On Sat, Feb 26, 2011 at 12:22 AM, Steve Ellcey <s...@cup.hp.com> wrote:
>> >
>> > I am looking at an lto bug on ia64-hp-hpux11.23.  If I compile
>> > g++.dg/torture/pr33572.C with -flto on this platform I get:
>> >
>> > ld: Unsatisfied symbol "__gcc_personality_v0" in file 
>> > /var/tmp//ccYlpGzO.ltrans0.ltrans.o
>> > 1 errors.
>> > collect2: ld returned 1 exit status
>> >
>> > (This is using the HP linker which I do for all my GCC builds.)
>>
>> so you do not have the linker-plugin?
>
> Correct.
>
>> I think this hints at an issue with the collect2 LTO path.  It would
>> be interesting
>> to see where references to the missing symbols appear / vanish - just look
>> at all intermediate files generated.
>>
>> Richard.
>
> This is interesting, there seem to be two different variables at play
> here.  __gcc_personality_v0 and __gxx_personality_v0.  When I compile
> with '-flto -O2' the error I get is about __gcc_personality_v0.  When I
> look at the two assembly files created during this compililation I see:
>
> ccG1Elhg.ltrans0.s:     .global __gcc_personality_v0#
> ccG1Elhg.ltrans0.s:     .type   __gcc_personality_v0#, @function
> ccG1Elhg.ltrans0.s:     .personality    __gcc_personality_v0#
> pr33572.s:      stringz "\0014__gxx_personality_v0"
> pr33572.s:      .global __gxx_personality_v0#
> pr33572.s:      .type   __gxx_personality_v0#, @function
> pr33572.s:      .personality    __gxx_personality_v0#
>
> When I add -flto-partition=none to the compilation, I do not get the
> ltrans file and I do not get any reference to __gcc_personality_v0.
>
> I don't think GCC has a __gcc_personality_v0 function, does it?  This is
> probably why the linker is complaining, if you declare a function as
> external the HP linker will complain even if there are no uses of that
> function.  I think the GNU linker would ignore the external declaration
> if there are no uses of it.

The gcc_personality is provided by libgcc_s I think, it's what you
get when compiling C code with -fexceptions and install
cleanup handlers.

It seems that LTO comes to the conclusion that the C++ specific
personality is not necessary but the generic one suffices.  But
that should still be provided by the original link libraries.

Richard.

>
> Steve Ellcey
> s...@cup.hp.com
>
>
>
>

Reply via email to