Have g++ link in LIBUNWIND if it exists

Steve Ellcey sje@cup.hp.com
Mon Mar 4 17:10:00 GMT 2002

On IA64 HP-UX we use a seperate unwind library that comes with the
system instead of building it in to libgcc.  We would like this library
linked in to C++ programs along with libstdc++.  Is the following patch
an acceptable way to do this?  I couldn't find any better way to do it.

I am not including the IA64 specific changes to define LIBUNWIND, just
the g++ driver change that would be needed to use it if it is defined.
I looked for a place to document LIBUNWIND by searching for LIBSTDCXX
and didn't find it documented anywhere so I did not include any doc

If this is reasonable could someone approve it and check it in?  Then I
can do a seperate platform specific change to define LIBUNWIND on IA64
HP-UX and to not build unwind into libgcc for the platform.

2002-03-04  Steve Ellcey  <sje@cup.hp.com>
	* cp/g++spec.c (lang_specific_driver): Add LIBUNWIND to library list
	if it is defined.

*** gcc.orig/gcc/cp/g++spec.c	Mon Mar  4 15:40:36 2002
--- gcc/gcc/cp/g++spec.c	Mon Mar  4 17:07:14 2002
*************** lang_specific_driver (in_argc, in_argv, 
*** 261,266 ****
--- 261,270 ----
        arglist[j++] = LIBSTDCXX;
+ #ifdef LIBUNWIND
+       arglist[j++] = LIBUNWIND;
+       added_libraries++;
+ #endif
    if (saw_math)
      arglist[j++] = saw_math;

More information about the Gcc-patches mailing list