__gthrw_pthread_once undefined...

__gthrw_pthread_once undefined...


I try to use icc 20051201 on an up to date FC4 system which has the gcc 4.0.2 compiler and run-time. Compiling and application using -pthread and linking with -pthread gives:

cint/src/bc_autoobj.o(.text+0x302): In function `G__push_autoobjectstack':
cint/src/bc_autoobj.cxx: undefined reference to `__gthrw_pthread_once(int*, void (*)())'

Where can I find this __gthrw_pthread_once() function?

Cheers, Fons.

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Fons,

gcc added a weakref attribute in gcc 4.1, and this has been back ported to earlier gcc releases, including some gcc 4.0.2 builds.

$ icpc hello.cpp
/tmp/icpcNESOf3.o(.text+0x52c): In function `main':
hello.cpp: undefined reference to `__gthrw_pthread_once(int*, void (*)())'

For now, the work around is to use:
$ icpc hello.cpp -D_GLIBCXX_GTHREAD_USE_WEAK=0 -pthread

We expect to support this feature without the above work around in the 9.1 release that is upcoming, expected in the next few months. The gcc feature was introduced in gcc 4.1, and has been back ported to earlier gcc releases. I suggest you open a support issue at http://premier.intel.com so you will be notified when this feature is available in the 9.1 compilers.

FYI there isa similar thread on this topic at

best regards,

Leave a Comment

Please sign in to add a comment. Not a member? Join today