- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- pthread includes trouble with gcc
Operating System - Linux
1823471
Members
2342
Online
109660
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2005 05:24 AM
тАО08-18-2005 05:24 AM
Hi,
I'm trying to understand a small issue I see during a compile.
I'm using gcc 3.4.3 from the hp-ux porting archive for the compile.
The software is the backup tool bacula, which to compile on HP-UX is on my todo-list for almost two years now ;)
(I could try to swremove the current gcc and use the itrc version, but right now I'm happy to have grasped the problem and would rather try to fix it)
during make I get the following error:
/usr/local/bin/g++ -L../lib -L../cats -o bconsole console.o console_conf.o authenticate.o conio.o \
-lcurses -lbac -lm -lgen
/usr/ccs/bin/ld: Unsatisfied symbols:
__pthread_cancel_stack (first referenced in ../lib/libbac.a(rwlock.o)) (code)
strings ./src/lib/rwlock.o | grep __pthread_cancel_stack
__pthread_cancel_stack
(yes, it's in there)
I grepped through the sourcetree and found no reference to this function.
After that I looked through /usr/include and found some function declarations refering it in sys/pthread.h:
grep pthread_cancel_stack /usr/include/sys/pthread.h
extern __pthread_cleanup_handler_t **__pthread_cancel_stack(void);
extern __pthread_cleanup_handler_t **__pthread_cancel_stack();
__pth_cleanup_push(func, arg, __pthread_cancel_stack())
But, this is what I don't understand:
where is pthread_cancel_stack defined?
I found nothing in /usr/include or whereever I looked.
(I also checked gcc's include directory out of bad experiences, but nothing there.)
I'd be really thankful if someone with a few spare minutes could give me a little explanation here... :)
Florian
I'm trying to understand a small issue I see during a compile.
I'm using gcc 3.4.3 from the hp-ux porting archive for the compile.
The software is the backup tool bacula, which to compile on HP-UX is on my todo-list for almost two years now ;)
(I could try to swremove the current gcc and use the itrc version, but right now I'm happy to have grasped the problem and would rather try to fix it)
during make I get the following error:
/usr/local/bin/g++ -L../lib -L../cats -o bconsole console.o console_conf.o authenticate.o conio.o \
-lcurses -lbac -lm -lgen
/usr/ccs/bin/ld: Unsatisfied symbols:
__pthread_cancel_stack (first referenced in ../lib/libbac.a(rwlock.o)) (code)
strings ./src/lib/rwlock.o | grep __pthread_cancel_stack
__pthread_cancel_stack
(yes, it's in there)
I grepped through the sourcetree and found no reference to this function.
After that I looked through /usr/include and found some function declarations refering it in sys/pthread.h:
grep pthread_cancel_stack /usr/include/sys/pthread.h
extern __pthread_cleanup_handler_t **__pthread_cancel_stack(void);
extern __pthread_cleanup_handler_t **__pthread_cancel_stack();
__pth_cleanup_push(func, arg, __pthread_cancel_stack())
But, this is what I don't understand:
where is pthread_cancel_stack defined?
I found nothing in /usr/include or whereever I looked.
(I also checked gcc's include directory out of bad experiences, but nothing there.)
I'd be really thankful if someone with a few spare minutes could give me a little explanation here... :)
Florian
yesterday I stood at the edge. Today I'm one step ahead.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-19-2005 02:10 AM
тАО08-19-2005 02:10 AM
Re: pthread includes trouble with gcc
I've got it solved, but I'd be still happy if someone could explain me what I actually did :)
I set LDFLAGS="-lcl -lpthread" , as I had that in my perl Configure notes, and this allowed the linking to work, as You can see here:
/usr/bin/ar rc libbac.a alloc.o attr.o base64.o berrno.o bsys.o bget_msg.o bnet.o bnet_server.o bpipe.o bshm.o btime.o cram-md5.o crc32.o daemon.o edit.o fnmatch.o hmac.o idcache.o jcr.o lex.o alist.o dlist.o md5.o message.o mem_pool.o parse_conf.o queue.o rwlock.o scan.o serial.o sha1.o semlock.o signal.o smartall.o tree.o util.o var.o watchdog.o workq.o btimers.o address_conf.o
ranlib libbac.a
I set LDFLAGS="-lcl -lpthread" , as I had that in my perl Configure notes, and this allowed the linking to work, as You can see here:
/usr/bin/ar rc libbac.a alloc.o attr.o base64.o berrno.o bsys.o bget_msg.o bnet.o bnet_server.o bpipe.o bshm.o btime.o cram-md5.o crc32.o daemon.o edit.o fnmatch.o hmac.o idcache.o jcr.o lex.o alist.o dlist.o md5.o message.o mem_pool.o parse_conf.o queue.o rwlock.o scan.o serial.o sha1.o semlock.o signal.o smartall.o tree.o util.o var.o watchdog.o workq.o btimers.o address_conf.o
ranlib libbac.a
yesterday I stood at the edge. Today I'm one step ahead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-20-2005 12:49 PM
тАО08-20-2005 12:49 PM
Solution
Well it doesn't use __pthread_cancel_stack() directory, but it does use pthread_cleanup_push().
pthread_cleanup_push() is defined in as
#define pthread_cleanup_push(func, arg) \
__pth_cleanup_push(func, arg, __pthread_cancel_stack())
So that's where __pthread_cancel_stack() gets to get used indirectly.
Anyway, these functions are defined in libpthread. By adding it to LDFLAGS I assume libpthread gets added to g++ line (-lpthread) as in
/usr/local/bin/g++ -L../lib -L../cats -o bconsole console.o console_conf.o authenticate.o conio.o \
-lcurses -lbac -lm -lgen -lpthread
so __pthread_cancel_stack() will be resolved when it gets referenced through libbac.a (rwlock.o).
Hope that's not as clear as mud :-)
pthread_cleanup_push() is defined in
#define pthread_cleanup_push(func, arg) \
__pth_cleanup_push(func, arg, __pthread_cancel_stack())
So that's where __pthread_cancel_stack() gets to get used indirectly.
Anyway, these functions are defined in libpthread. By adding it to LDFLAGS I assume libpthread gets added to g++ line (-lpthread) as in
/usr/local/bin/g++ -L../lib -L../cats -o bconsole console.o console_conf.o authenticate.o conio.o \
-lcurses -lbac -lm -lgen -lpthread
so __pthread_cancel_stack() will be resolved when it gets referenced through libbac.a (rwlock.o).
Hope that's not as clear as mud :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-23-2005 10:04 AM
тАО08-23-2005 10:04 AM
Re: pthread includes trouble with gcc
I think I understood it now :)))
yesterday I stood at the edge. Today I'm one step ahead.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP