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]
Other format: [Raw text]

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


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