This is the mail archive of the gcc@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: dlopen and template instantiation


On Tue, Jul 15, 2003 at 11:39:34AM -0400, Stefan Seefeld wrote:
> hi there,
> 
> I'v a problem with duplicate template instantiation in code
> using dlopen...
> 
> I'm using a 'singleton' template to access a global object.
> The singleton is accessed from within a library libfoo.so,
> as well as from within a python module bar.so (written with
> boost::python), which is linked to libfoo.so.
> 
> When I run a python script that uses the 'bar' module, I see
> that two distinct instances of the singleton are accessed.
> 
> How does gcc deal with this case ? Shouldn't static template members
> be defined as weak symbols such that only one instance is used ?
> 
> Is there anything I have to do to make template instantiation work
> with dlopen ?
> 
> I'm using RH 9 with gcc 3.2...
> 

It may be a glibc issue. See

http://sources.redhat.com/ml/libc-alpha/2002-05/msg00197.html
http://sources.redhat.com/ml/libc-alpha/2002-05/msg00214.html



H.J.


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