The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Operating Systems > HP-UX
.
google unix.com



HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Problem with pthreads sery0ga High Level Programming 3 02-21-2007 10:40 AM
PThreads justgotthis High Level Programming 0 10-08-2005 03:01 PM
pthreads Esaia High Level Programming 2 06-04-2003 06:32 PM
pthreads fishman2001 High Level Programming 6 06-25-2002 05:01 AM
PThreads S.P.Prasad UNIX for Advanced & Expert Users 3 06-06-2002 11:23 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-22-2007
zackz zackz is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 5
pthreads

Hi!
I'm linking my hpux code using -lpthread (gcc), yet it references libpthread_tr.1,
the debug version of the pthread lib. How do I force it to use pthreads?

Thanks,
  #2 (permalink)  
Old 01-23-2007
andryk's Avatar
andryk andryk is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2003
Posts: 448
Thats weird, did you check the output of these
Code:
ldd yourproggy
ls -l /lib/libpthread.sl

To use that lib with tracing facility you have to explicitly use -lpthread_tr, maybe /lib/libpthread.sl is pointing to libpthread_tr
  #3 (permalink)  
Old 01-23-2007
zackz zackz is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 5
Thanks for the reply andryk. That's what stumps me.

Here's ldd on my binary:

/usr/lib/libc.2 => /usr/lib/libc.2
/opt/langtools/lib/libpthread_tr.1 => /opt/langtools/lib/libpthread_tr.1
/usr/lib/libxti.2 => /usr/lib/libxti.2

The odd man out here is /opt/langtools/lib/libpthread_tr.1

Where is it picking up /opt/langtools/lib from? I didn't specify it in the linker path. I'm not even specifying -lpthreads, instead using the gcc pthread option -D_REENTRANT -pthread

I haven't explicity specified -L/opt/langtools anywhere in the linker path.

$ ls -l libpthread*
-r-xr-xr-x 1 bin bin 159744 Apr 13 2004 libpthread.1
-r-xr-xr-x 1 bin bin 228486 Apr 13 2004 libpthread.a
lrwxr-xr-x 1 root root 21 Aug 4 2005 libpthread.sl -> /usr/lib/libpthread.1
-r-xr-xr-x 1 bin bin 184320 Apr 13 2004 libpthread_tr.1
-r-xr-xr-x 1 bin bin 258058 Apr 13 2004 libpthread_tr.a
lrwxr-xr-x 1 root root 24 Aug 4 2005 libpthread_tr.sl -> /usr/lib/libpthread_tr.1

Strangely,
lrwxr-xr-x 1 bin bin 24 Aug 31 13:22 libpthread.1 -> /usr/lib/libpthread_tr.1
lrwxr-xr-x 1 bin bin 14 Aug 31 13:22 libpthread.sl -> ./libpthread.1
lrwxr-xr-x 1 root sys 24 Jan 22 10:14 libpthread_tr.1 -> /usr/lib/libpthread_tr.1

Is there a way to force a hpux binary to use /usr/lib/libpthread.sl instead of the trace version?
  #4 (permalink)  
Old 01-24-2007
andryk's Avatar
andryk andryk is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2003
Posts: 448
I think you can safely correct the link libpthread.sl to point to /lib/libpthread.1 as i have this on my hp11.00-pa (and use the -lpthread for linking), /usr/lib/libpthread.1 is the same file as /lib/libpthread.1 not a link to /usr/lib/libpthread_tr.1.

Code:
root@hp1100:/usr/lib>
-r-xr-xr-x  1 bin  bin  139264 Jul 12  2002 libpthread.1
-r-xr-xr-x  1 bin  bin  226958 Jul 12  2002 libpthread.a
lrwxr-xr-x  1 root root     21 Jan 26  2002 libpthread.sl -> /usr/lib/libpthread.1
-r-xr-xr-x  1 bin  bin  167936 Jul 12  2002 libpthread_tr.1
-r-xr-xr-x  1 bin  bin  257038 Jul 12  2002 libpthread_tr.a
lrwxr-xr-x  1 root root     24 Jan 26  2002 libpthread_tr.sl -> /usr/lib/libpthread_tr.1

Maybe someone else is working with pthread on your box and did that setting
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:20 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0