This is the mail archive of the
mailing list for the GCC project.
Re: Stl -frepo
- To: cdern at pre dot com (Chris Dern)
- Subject: Re: Stl -frepo
- From: scott snyder <snyder at d0sgif dot fnal dot gov>
- Date: Thu, 26 Feb 1998 00:11:04 CST
- Cc: egcs at cygnus dot com
>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
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-188.8.131.52.15)') 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 <email@example.com>
* tlink.c (scan_linker_output): Recognize mangled names
*** tlink.c 1997/10/17 19:03:41 184.108.40.206
--- tlink.c 1997/11/21 19:29:43
*** 573,578 ****
--- 573,580 ----
*q = 0, dem = demangled_hash_lookup (p, false);
sym = symbol_hash_lookup (dem->mangled, false);
+ else if (q)
+ sym = symbol_hash_lookup (p, false);
if (sym && sym->tweaked)