This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gcc/g++ driver changes for libunwind


This is another libunwind related cleanup.

There are two places in init_spec in gcc.c where we call init_gcc_specs.  The
LINK_LIBGCC_SPECIAL case was missing a reference to -lunwind.  This patch adds
it.

The g++ driver has support to add -lunwind, but this is completely unnecessary.
The main gcc driver already handles this, and we don't need multiple -lunwind
options.  This patch deletes this support.  There is no place in the gcc
sources where LIBUNWIND is defined, so this isn't doing anything useful.

This was tested with an ia64-linux bootstrap and make check, on a debian
testing (sarge) system with libunwind-0.95 installed.  Since there is no system
that has both libunwind and LINK_LIBGCC_SPECIAL defined, I tested that by
adding a definition to the ia64-linux port and building the C compiler to make
sure it was working as intended.

After doing most of this I noticed that libstdc++-v3 also has unnecessary
uses of LIBUNWIND, but I've done enough libunwind work for now, so I just
documented that with a bug report, PR 13296.

gcc/ChangeLog
2003-12-03  James E Wilson  <wilson@specifixinc.com>

	* gcc.c (init_spec): Pass -lunwind to init_gcc_specs in eh_name.

gcc/cp/ChangeLog
2003-12-03  James E Wilson  <wilson@specifixinc.com>

	* g++spec.c (lang_specific_driver): Delete USE_LIBUNWIND_EXCEPTIONS
	support.

Index: gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.395
diff -p -r1.395 gcc.c
*** gcc.c	23 Oct 2003 19:27:41 -0000	1.395
--- gcc.c	3 Dec 2003 02:01:28 -0000
*************** init_spec (void)
*** 1654,1660 ****
  #endif
  			    ,
  			    "libgcc.a%s",
! 			    "libgcc_eh.a%s");
  	    p += 10;
  	    in_sep = 0;
  	  }
--- 1656,1666 ----
  #endif
  			    ,
  			    "libgcc.a%s",
! 			    "libgcc_eh.a%s"
! #ifdef USE_LIBUNWIND_EXCEPTIONS
! 			    " -lunwind"
! #endif
! 			    );
  	    p += 10;
  	    in_sep = 0;
  	  }
Index: cp/g++spec.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/g++spec.c,v
retrieving revision 1.40
diff -p -r1.40 g++spec.c
*** cp/g++spec.c	30 Sep 2003 21:48:59 -0000	1.40
--- cp/g++spec.c	3 Dec 2003 02:01:29 -0000
*************** lang_specific_driver (int *in_argc, cons
*** 302,314 ****
      {
        arglist[j++] = saw_profile_flag ? LIBSTDCXX_PROFILE : LIBSTDCXX;
        added_libraries++;
- #ifdef USE_LIBUNWIND_EXCEPTIONS
- # ifndef LIBUNWIND
- #  define LIBUNWIND "-lunwind"
- # endif
-       arglist[j++] = LIBUNWIND;
-       added_libraries++;
- #endif
      }
    if (saw_math)
      arglist[j++] = saw_math;
--- 302,307 ----
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]