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

Re: STL/thread-safe/template problem on Alpha.


Wegher, Jeff <JWegher@neonsoft.com> writes:

> (alphaev56-dec-osf4.0b) with the 1.1a (egcs-2.91.57)

> #include <list>
> int main() { list<int> aList; return 0; }

> g++ -D__STL_PTHREADS -D_REENTRANT testList.cpp -lpthread

> /usr/bin/ld:
> Unresolved:
> __default_alloc_template<1, 0>::end_free  
> __default_alloc_template<1, 0>::start_free  
> __default_alloc_template<1, 0>::heap_size  
> __default_alloc_template<1, 0>::free_list  
> __default_alloc_template<1, 0>::__node_allocator_lock  
> collect2: ld returned 1 exit status

> Any ideas/workarounds?  

Compiling with the template repository (-frepo) works.  Another option
is explicit instantiation of the symbols that are not automatically
instantiated for some reason (lack of GNU ld?):

template char*__default_alloc_template<1, 0>::end_free;
template char*__default_alloc_template<1, 0>::start_free;
template size_t __default_alloc_template<1, 0>::heap_size;
template __default_alloc_template<1, 0>::obj * volatile __default_alloc_template<1, 0>::free_list[];
template pthread_mutex_t __default_alloc_template<1, 0>::__node_allocator_lock;

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil



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