This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: f build dies with: undefined reference to `lookup_name'
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: Geoff Keating <geoffk at redhat dot com>
- Cc: amodra at bigpond dot net dot au, rth at redhat dot com, gcc-patches at gcc dot gnu dot org
- Date: Thu, 14 Mar 2002 21:35:25 -0500
- Subject: Re: f build dies with: undefined reference to `lookup_name'
>>>>> Geoff Keating writes:
Geoff> Firstly, how do these work in C++? In particular, if I write
Geoff> do I get foo::bar weak, ::bar weak, everything named 'bar' weak, or
Geoff> something else? I believe the correct thing is to have foo::bar,
Geoff> only, be weak. The current compiler seems to make
Geoff> 'extern "C" bar' weak, which indicates (at least to me) that no-one
Geoff> thought about this at all :-). I believe that Alan's patch will
Geoff> change this behaviour in an improving direction, but I think from the
Geoff> description it will pick ::bar, because ::bar's decl is visible at the
Geoff> point of the pragma under the name 'bar'.
Your intuition is wrong with respect to the Solaris C Compiler
semantics for #pragma.
#pragma weak bar
makes "bar" weak. No mangling. If you want mangled bar weak, you need to
explicitly state the mangled string in the pragma. If you want to define
some new, incompatible semantics for #pragma, that is fine, but I'm not
working on it.
David