This is the mail archive of the 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]

Re: Stl -frepo

>You were correct, the STL bug involved my faulty code. However, the
>-frepo option dosent correctly compile the code, and results in this
>error. If I compile it without the
>-frepo, it compiles and runs fine.

If you're using GNU ld, -frepo might not work with egcs (or gcc 2.8).
The problem is that GNU ld does its own demangling, and collect2 looks
for the demangled names in the ld output.  However, if the demangler
in ld is not in sync with the compiler, it can get mangled names that
it doesn't recognize.  In that case, it will output the mangled name
directly, confusing collect2.

I sent in a patch for this several months ago; i'm appending that
message below.



hi -

I ran into a problem recently with egcs 971114 on linux in which
template member functions and templates involving nested types were
not being automatically instantiated with -frepo.

I tracked this down to miscommunication between ld and tlink.
tlink looks for symbol names in either mangled form as the first
word on a line, or in demangled form inside of single quotes.  GNU ld
uses the second form of message.  However, it appears that the demangling
code in ld (version string
`GNU ld version cygnus-2.8.1 (with BFD linux-') is not in sync
with egcs, since for the template instantiations which were giving
problems, ld was using the mangled form in the error message.

Eventually, i suppose, the demangling code will be the same everywhere.
In the meantime, though, it seemed reasonable to modify tlink so that
it could also recognize mangled names inside quotes.  The appended
patch implements that, and fixes the problem for me.


1997-11-20  scott snyder  <>

        * tlink.c (scan_linker_output): Recognize mangled names
        in quotes.

*** tlink.c     1997/10/17 19:03:41
--- tlink.c     1997/11/21 19:29:43
*** 573,578 ****
--- 573,580 ----
            *q = 0, dem = demangled_hash_lookup (p, false);
          if (dem)
            sym = symbol_hash_lookup (dem->mangled, false);
+           else if (q)
+             sym = symbol_hash_lookup (p, false);
        if (sym && sym->tweaked)

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