Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
Languages and Scripting
cancel
Showing results for 
Search instead for 
Did you mean: 

unsatisfied pthread symbols in gcc

Andreas Meinhardt
Occasional Visitor

unsatisfied pthread symbols in gcc

Hi all,

I dowloaded gcc 4.2.4 and 4.3.1 for HP-UX 11.11 (HP-UX hp9000 B.11.11 U 9000/785 2003690492 unlimited-user license
)from itrc and consistently have the following error:
-bash-3.2# /opt/hp-gcc64/bin/gcc hello.c
/usr/lib/pa20_64/dld.sl: Unsatisfied data symbol 'pthread_mutex_lock' in load module '/opt/hp-gcc64/bin/gcc'.
/usr/lib/pa20_64/dld.sl: Unsatisfied data symbol 'pthread_mutex_unlock' in load module '/opt/hp-gcc64/bin/gcc'.
/usr/lib/pa20_64/dld.sl: Unsatisfied data symbol 'pthread_attr_setdetachstate' in load module '/opt/hp-gcc64/bin/gcc'.
/usr/lib/pa20_64/dld.sl: Unsatisfied data symbol 'pthread_attr_destroy' in load module '/opt/hp-gcc64/bin/gcc'.
ABORT instruction (core dumped)


it's not that libpthread would be missing, it's where it's supposed to be:
-bash-3.2# find / -name libpthread* -print
/usr/lib/libpthread.1
/usr/lib/pa20_64/libp/libpthread.a
/usr/lib/pa20_64/libpthread.a
/usr/lib/pa20_64/libpthread_tr.a
/usr/lib/pa20_64/libpthread.1
/usr/lib/pa20_64/libpthread.sl
/usr/lib/pa20_64/libpthread_tr.1
/usr/lib/pa20_64/libpthread_tr.sl
/usr/lib/libpthread.sl
/usr/lib/libpthread_tr.1
/usr/lib/libpthread_tr.sl
/usr/lib/libp/libpthread.a
/usr/lib/libpthread.a
/usr/lib/libpthread_tr.a


Anyone seen this before??

I much appreciate any hint, as I never had this issue before!

Thanks

Andreas
6 REPLIES
OldSchool
Honored Contributor

Re: unsatisfied pthread symbols in gcc

What, if anything, is in SHLIB_PATH?

You also might need to build w/ -l pthread
option
Andreas Meinhardt
Occasional Visitor

Re: unsatisfied pthread symbols in gcc

SHLIBPATH is not set.

actually I am thinking of rebuilding gcc from source.

I also get this error on ANY program (example above is just HelloWorld.c), so it does not involve any threads at all.

Thanks

Andreas
Dennis Handly
Acclaimed Contributor

Re: unsatisfied pthread symbols in gcc

>Anyone seen this before??

Over and over. You have a lemon libc. gcc expects that you have a newer one that supports the pthread_* stubs, since gcc isn't linked with libpthread, since it doesn't need it.

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1186353
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1023298

>OldSchool: What is in SHLIB_PATH?
>You also might need to build with -lpthread

Actually that's the whole purpose of the pthread_* stubs in libc. So you don't have to do that and so you don't lose performance.
Highlighted
Andreas Meinhardt
Occasional Visitor

Re: unsatisfied pthread symbols in gcc

Dennis,
you're my hero!

Thanks a bunch!

Andreas
Andreas Meinhardt
Occasional Visitor

Re: unsatisfied pthread symbols in gcc

Works like a charm after installing the patch!

Thank you!!

Andreas
Dennis Handly
Acclaimed Contributor

Re: unsatisfied pthread symbols in gcc

>Works like a charm after installing the patch!

If you are happy with the answers, please read the following about assigning points and reopening threads:
http://forums.itrc.hp.com/service/forums/helptips.do?#33
http://forums.itrc.hp.com/service/forums/helptips.do?#41