PATCH to deal with dependant function templates using -frepo

Michael Welsh Duggan md5i@cs.cmu.edu
Fri Jul 23 14:51:00 GMT 1999


Here is a patch which fixes the problem mentioned in
<URL: http://egcs.cygnus.com/ml/gcc-bugs/1999-07/msg00616.html >.  I
don't know whether this is the best solution; it ends up recompiling a
file multiple times until it has found all the dependant templates.
Before this patch, the code was catching the `int b<int>(int)' in the
following error produced by ld:

foo.o: In function `int b<int>(int)':
foo.o(.text+0x32): undefined reference to `int a<int>(int)'

Since `int b<int>(int)' had already been tweaked, it was bailing out
before it noticed the not-yet-instantiated `int a<int>(int)'.

Fri Jul 23 17:26:01 1999  Michael Welsh Duggan  <md5i@cs.cmu.edu>

        * tlink.c (scan_linker_output): Don't bail out when encountering
        an already tweaked symbol.

Index: tlink.c
===================================================================
RCS file: /cvs/egcs/egcs/gcc/tlink.c,v
retrieving revision 1.21
diff -c -p -r1.21 tlink.c
*** tlink.c     1999/03/25 11:50:02     1.21
--- tlink.c     1999/07/23 21:37:48
*************** scan_linker_output (fname)
*** 658,669 ****
            }
        }
  
!       if (sym && sym->tweaked)
!       {
!         fclose (stream);
!         return 0;
!       }
!       if (sym && !sym->tweaking)
        {
          if (tlink_verbose >= 2)
            fprintf (stderr, "collect: tweaking %s in %s\n",
--- 658,664 ----
            }
        }
  
!       if (sym && !sym->tweaking && !sym->tweaked)
        {
          if (tlink_verbose >= 2)
            fprintf (stderr, "collect: tweaking %s in %s\n",

-- 
Michael Duggan
(md5i@cs.cmu.edu)


More information about the Gcc-patches mailing list