This is the mail archive of the
mailing list for the GCC project.
Re: RFC: when using libunwind, add -lunwind to link line when usingshared libgcc
- From: "Zack Weinberg" <zack at codesourcery dot com>
- To: Jim Wilson <wilson at specifixinc dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 08 Jan 2004 23:14:11 -0800
- Subject: Re: RFC: when using libunwind, add -lunwind to link line when usingshared libgcc
- References: <firstname.lastname@example.org><3FFE4B7C.email@example.com>
Jim Wilson <firstname.lastname@example.org> writes:
> It was made unnecessary by a change to config/t-libunwind that linked
> libgcc_s.so with libunwind by adding it to SHLIB_LC. libgcc_s.so thus
> brings in libunwind via DT_NEEDED, and there is no need for the gcc
> driver to link with libunwind a second time. That serves no
> purpose. The DT_NEEDED for libunwind incidentally is necessary for
> other reasons, without it, some uses of libgcc can fail. We can't
> rely on the gcc driver to supply the necessary -lunwind linker command.
> Unfortunately, I now see that HPUX is a complication. HPUX is also
> using the USE_LIBUNWIND_EXCEPTIONS stuff, but in a different way than
> linux. HPUX has its own SHLIB* macros in config/ia64/t-hpux. I'd
> suggest a better way to fix this is to modify the t-hpux SHLIB_LINK to
> include a -lunwind, and remove (again) the -lunwind from the shared
> part of init_gcc_specs.
> I don't have a copy of hpux to test this with. I am not willing to
> spend my own money to buy a copy.
I will test this patch on ia64-hpux.
I strongly suspect that it will not work, however; I remember
DT_NEEDED not being honored by the HPUX linker/loader.