This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Use libunwind library when linking g++
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: rth at redhat dot com
- Date: Thu, 13 Jun 2002 12:29:04 -0700 (PDT)
- Subject: Re: [PATCH] Use libunwind library when linking g++
- Reply-to: sje at cup dot hp dot com
Here is a new version of my libunwind patch in response to Richard's
comments. I will send a seperate mail for the libjava change so I can
send it to the java-patches mailing list as well as gcc-patches.
I changed CONFIG_LIBUNWIND_EXCEPTIONS to USE_LIBUNWIND_EXCEPTIONS and
removed by change to config.in. I got errors when I tried to regenerate
config.in with autoheader until I added a change to acconfig.h. I don't
know if this is right or not, acconfig.h has no comments about being
generated by a tool but other things set in configure.in don't seem to
be listed here. Am I missing something? Or perhaps using the wrong
version of autoheader (I used 2.13). I included my change to acconfig.h
in this patch.
> From: Richard Henderson <rth@redhat.com>
>
> The patch doesn't control the generation of libgcc_eh.
> What's going to happen when both libgcc_eh and libunwind
> appear on the same link line? Are we absolutely certain
> that libunwind is a superset of libgcc_eh and so having
> the both cannot result in multiply defined symbols?
Well, I am pretty sure that my libunwind is a superset of libgcc_eh. I
don't know if there is anyway to ensure that in general. It might be
nice if the use of --enable-libunwind-exceptions turned off the use of
libgcc_eh. I am not sure how to do that though, I looked at init_spec
and init_gcc_specs and it looks pretty convoluted. I am setting
LIBGCC_SPEC for my platform (IA64 HP-UX) and I think that that is
"accidently" preventing libgcc_eh.a from ever being added to my link
line.
It seems a little odd to me that even if I specify LIBGCC_SPEC the
functions init_spec/init_gcc_specs still mangles what I set it to. This
makes it harder to tell GCC not to use libgcc_eh but it seems
intentional.
Steve Ellcey
sje@cup.hp.com
2002-06-13 Steve Ellcey <sje@cup.hp.com>
* gcc/configure.in (USE_UNWIND_EXCEPTIONS): Add support to set
USE_UNWIND_EXCEPTIONS if --enable-libunwind-exceptions is set.
* gcc/configure: Regenerate
* gcc/config.in: Regenerate
* gcc/acconfig.h (USE_UNWIND_EXCEPTIONS): Set to undef by default.
*** gcc.orig/gcc/configure.in Thu Jun 13 10:37:30 2002
--- gcc/gcc/configure.in Thu Jun 13 10:56:07 2002
*************** AC_ARG_ENABLE(sjlj-exceptions,
*** 2337,2342 ****
--- 2337,2351 ----
AC_DEFINE_UNQUOTED(CONFIG_SJLJ_EXCEPTIONS, $sjlj,
[Define 0/1 to force the choice for exception handling model.])])
+ # Use libunwind based exception handling.
+ AC_ARG_ENABLE(libunwind-exceptions,
+ [ --enable-libunwind-exceptions force use libunwind for exceptions],
+ use_libunwind_exceptions=$enableval,
+ use_libunwind_exceptions=no)
+ if test x"$use_libunwind_exceptions" = xyes; then
+ AC_DEFINE(USE_LIBUNWIND_EXCEPTIONS, 1)
+ fi
+
# Make empty files to contain the specs and options for each language.
# Then add #include lines to for a compiler that has specs and/or options.
*** gcc.orig/gcc/acconfig.h Thu Jun 13 10:37:39 2002
--- gcc/gcc/acconfig.h Thu Jun 13 10:54:58 2002
***************
*** 29,34 ****
--- 29,37 ----
/* Define if cpp should also search $prefix/include. */
#undef PREFIX_INCLUDE_DIR
+ /* Define if gcc should use -lunwind. */
+ #undef USE_LIBUNWIND_EXCEPTIONS
+
@BOTTOM@
/* Bison unconditionally undefines `const' if neither `__STDC__' nor