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]

PATCH to collect2.c


Ever since I tweaked my copy of libiberty/cp-demangle.c to always give me
the verbose form, g++.pt/repo4.C has been failing due to mismatch between
collect's notion of a demangled name and the linker's.  There's really no
good reason for the linker to be demangling at all if collect will, so this
patch suppresses that.

2001-07-10  Jason Merrill  <jason_merrill@redhat.com>

	* collect2.c (main): Set COLLECT_NO_DEMANGLE for subprocesses.
	(dump_file): Only pad the demangled name with spaces if the 
	mangled name was padded with spaces.

*** collect2.c.~1~	Sat Apr 28 00:41:39 2001
--- collect2.c	Tue Jul 10 16:22:21 2001
*************** int do_collecting = 1;
*** 163,168 ****
--- 163,172 ----
  #else
  int do_collecting = 0;
  #endif
+ 
+ /* Nonzero if we should suppress the automatic demangling of identifiers
+    in linker error messages.  Set from COLLECT_NO_DEMANGLE.  */
+ int no_demangle;
  
  /* Linked lists of constructor and destructor names.  */
  
*************** dump_file (name)
*** 522,528 ****
       const char *name;
  {
    FILE *stream = fopen (name, "r");
-   int no_demangle = !! getenv ("COLLECT_NO_DEMANGLE");
  
    if (stream == 0)
      return;
--- 526,531 ----
*************** dump_file (name)
*** 556,562 ****
  	      fputs (result, stderr);
  
  	      diff = strlen (word) - strlen (result);
! 	      while (diff > 0)
  		--diff, putc (' ', stderr);
  	      while (diff < 0 && c == ' ')
  		++diff, c = getc (stream);
--- 559,565 ----
  	      fputs (result, stderr);
  
  	      diff = strlen (word) - strlen (result);
! 	      while (diff > 0 && c == ' ')
  		--diff, putc (' ', stderr);
  	      while (diff < 0 && c == ' ')
  		++diff, c = getc (stream);
*************** main (argc, argv)
*** 857,862 ****
--- 860,870 ----
    const char **object;
    int first_file;
    int num_c_args	= argc+9;
+ 
+   no_demangle = !! getenv ("COLLECT_NO_DEMANGLE");
+ 
+   /* Suppress demangling by the real linker, which may be broken.  */
+   putenv (xstrdup ("COLLECT_NO_DEMANGLE="));
  
  #if defined (COLLECT2_HOST_INITIALIZATION)
    /* Perform system dependent initialization, if neccessary.  */

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