Operating System - HP-UX
1834644 Members
2512 Online
110069 Solutions
New Discussion

Re: libpthread.1 + HPUX 11.11

 
SOLVED
Go to solution
pramodsharma
Advisor

libpthread.1 + HPUX 11.11

Hi ,
My application and third parties like boost uses libpthread to create threads.

I had applied latest available patches for pthread .

I am not able to find the symbol pthread_create in libpthread.1 . So I am getting the unresolved symbol pthread_create in the application.

Can anyone please point me out from where I can get the libpthread.1 for 11.11 which contains these symbols ?

bash-2.04# what libpthread.1
libpthread.1:
specific.c $Date: 2004/03/03 03:30:19 $Revision: r11.11/1 PATCH_11.11 (PHCO_30544)
pthread.c $Date: 2007/03/30 02:03:32 $Revision: r11.11/4 PATCH_11.11 (PHCO_36229)
stack.c $Date: 2007/03/30 02:03:40 $Revision: r11.11/1 PATCH_11.11 (PHCO_36229)
cancel.c $Date: 2007/04/16 03:37:13 $Revision: r11.11/4 PATCH_11.11 (PHCO_36229)
pthread_attr.c $Date: 2007/03/30 02:03:36 $Revision: r11.11/1 PATCH_11.11 (PHCO_36229)
Pthread Interfaces
$Revision: libpthread.1: R11.11_BL2007_0420_1


bash-2.04# nm libpthread.1 | grep pthread_create
__pthread_create_system| 35316|uext |stub |
__pthread_create_system| 48508|extern|entry |
__pthread_create_system| 48532|extern|code |$CODE$


Thanks in advance,
Pramod

9 REPLIES 9
Dennis Handly
Acclaimed Contributor
Solution

Re: libpthread.1 + HPUX 11.11

pthread_create doesn't exist in libpthread.1 on 11.11. It is only there on 11.23.

When you use it creates a pthread_create stub that calls the real function __pthread_create_system.

>So I am getting the unresolved symbol pthread_create in the application.

If you get an unsat, it means you have illegally called pthread_create without the proper header file, .
pramodsharma
Advisor

Re: libpthread.1 + HPUX 11.11

Thanks Dennis for the quick response.
I understand the problem at least . I didn't use illegaly , in fact I was developing in 11.23 and then running the same binary on 11.11 . So it comes from there .

Can I use some compiler flag or something while developing it on 11.23 that it becomes compatible with 11.11 ?

Regards,
Pramod
Dennis Handly
Acclaimed Contributor

Re: libpthread.1 + HPUX 11.11

>Can I use some compiler flag or something while developing it on 11.23 that it becomes compatible with 11.11?

No, HP-UX is only forward compatible and your header files are completely different.

The only other solution is to set up a SDK:
http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,2548,00.html
pramodsharma
Advisor

Re: libpthread.1 + HPUX 11.11

Got it .. PTHREAD_COMPAT_MODE.
Thanks Dennis it was much of help .
Dennis Handly
Acclaimed Contributor

Re: libpthread.1 + HPUX 11.11

>PTHREAD_COMPAT_MODE.

This will not let you compile on 11.23 and move back to 11.11. It may remove that pthread_create unsat though.
pramodsharma
Advisor

Re: libpthread.1 + HPUX 11.11

No it does. I just tested it .
Compile a code with PTHREAD_COMPAT_MODE on 11.23 and then was able to run on both 11.23 and 11.11

sh-2.04# nm testthread | grep pthread
__pthread_create_system| |undef |code |
__pthread_create_system| 12240|uext |stub |
pthread_create | 12216|extern|entry |
pthread_create | 12264|extern|code |$CODE$
Dennis Handly
Acclaimed Contributor

Re: libpthread.1 + HPUX 11.11

>No it does. I just tested it .
Compile a code with PTHREAD_COMPAT_MODE on 11.23 and then was able to run on both 11.23 and 11.11

Let me make this very clear. This is NOT supported!

If your 11.23 system headers just happen to make use of 11.23 kernel functionality, this will NOT work on 11.11.
pramodsharma
Advisor

Re: libpthread.1 + HPUX 11.11

Yes I understand the implications. Will forward this to management.

Thanks

pramodsharma
Advisor

Re: libpthread.1 + HPUX 11.11

Thanks