<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: pthread includes trouble with gcc in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/pthread-includes-trouble-with-gcc/m-p/4919265#M104342</link>
    <description>I think I understood it now :)))</description>
    <pubDate>Tue, 23 Aug 2005 17:04:40 GMT</pubDate>
    <dc:creator>Florian Heigl (new acc)</dc:creator>
    <dc:date>2005-08-23T17:04:40Z</dc:date>
    <item>
      <title>pthread includes trouble with gcc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-includes-trouble-with-gcc/m-p/4919262#M104339</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I'm trying to understand a small issue I see during a compile.&lt;BR /&gt;&lt;BR /&gt;I'm using gcc 3.4.3 from the hp-ux porting archive for the compile.&lt;BR /&gt;The software is the backup tool bacula, which to compile on HP-UX is on my todo-list for almost two years now ;)&lt;BR /&gt;&lt;BR /&gt;(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)&lt;BR /&gt;&lt;BR /&gt;during make I get the following error:&lt;BR /&gt;&lt;BR /&gt;/usr/local/bin/g++   -L../lib -L../cats -o bconsole console.o console_conf.o authenticate.o conio.o \&lt;BR /&gt;       -lcurses -lbac -lm -lgen&lt;BR /&gt;/usr/ccs/bin/ld: Unsatisfied symbols:&lt;BR /&gt;   __pthread_cancel_stack (first referenced in ../lib/libbac.a(rwlock.o)) (code)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;strings ./src/lib/rwlock.o | grep __pthread_cancel_stack&lt;BR /&gt;__pthread_cancel_stack&lt;BR /&gt;&lt;BR /&gt;(yes, it's in there)&lt;BR /&gt;&lt;BR /&gt;I grepped through the sourcetree and found no reference to this function.&lt;BR /&gt;&lt;BR /&gt;After that I looked through /usr/include and found some function declarations refering it in sys/pthread.h:&lt;BR /&gt;&lt;BR /&gt; grep pthread_cancel_stack  /usr/include/sys/pthread.h&lt;BR /&gt;extern __pthread_cleanup_handler_t      **__pthread_cancel_stack(void);&lt;BR /&gt;extern __pthread_cleanup_handler_t      **__pthread_cancel_stack();&lt;BR /&gt;        __pth_cleanup_push(func, arg, __pthread_cancel_stack())&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But, this is what I don't understand:&lt;BR /&gt;where is pthread_cancel_stack defined?&lt;BR /&gt;&lt;BR /&gt;I found nothing in /usr/include or whereever I looked.&lt;BR /&gt;&lt;BR /&gt;(I also checked gcc's include directory out of bad experiences, but nothing there.)&lt;BR /&gt;&lt;BR /&gt;I'd be really thankful if someone with a few spare minutes could give me a little explanation here... :)&lt;BR /&gt;&lt;BR /&gt;Florian&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Aug 2005 12:24:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-includes-trouble-with-gcc/m-p/4919262#M104339</guid>
      <dc:creator>Florian Heigl (new acc)</dc:creator>
      <dc:date>2005-08-18T12:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: pthread includes trouble with gcc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-includes-trouble-with-gcc/m-p/4919263#M104340</link>
      <description>I've got it solved, but I'd be still happy if someone could explain me what I actually did :)&lt;BR /&gt;&lt;BR /&gt;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:&lt;BR /&gt;&lt;BR /&gt;/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&lt;BR /&gt;ranlib libbac.a&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Aug 2005 09:10:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-includes-trouble-with-gcc/m-p/4919263#M104340</guid>
      <dc:creator>Florian Heigl (new acc)</dc:creator>
      <dc:date>2005-08-19T09:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: pthread includes trouble with gcc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-includes-trouble-with-gcc/m-p/4919264#M104341</link>
      <description>Well it doesn't use __pthread_cancel_stack() directory, but it does use pthread_cleanup_push().&lt;BR /&gt;&lt;BR /&gt;pthread_cleanup_push() is defined in &lt;SYS&gt; as&lt;BR /&gt;&lt;BR /&gt;#define pthread_cleanup_push(func, arg)         \&lt;BR /&gt;        __pth_cleanup_push(func, arg, __pthread_cancel_stack())&lt;BR /&gt;&lt;BR /&gt;So that's where __pthread_cancel_stack() gets to get used indirectly.&lt;BR /&gt;&lt;BR /&gt;Anyway, these functions are defined in libpthread. By adding it to LDFLAGS I assume libpthread gets added to g++ line (-lpthread) as in&lt;BR /&gt;&lt;BR /&gt;/usr/local/bin/g++ -L../lib -L../cats -o bconsole console.o console_conf.o authenticate.o conio.o \&lt;BR /&gt;-lcurses -lbac -lm -lgen -lpthread&lt;BR /&gt;&lt;BR /&gt;so __pthread_cancel_stack() will be resolved when it gets referenced through libbac.a (rwlock.o).&lt;BR /&gt;&lt;BR /&gt;Hope that's not as clear as mud :-)&lt;/SYS&gt;</description>
      <pubDate>Sat, 20 Aug 2005 19:49:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-includes-trouble-with-gcc/m-p/4919264#M104341</guid>
      <dc:creator>Ermin Borovac</dc:creator>
      <dc:date>2005-08-20T19:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: pthread includes trouble with gcc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pthread-includes-trouble-with-gcc/m-p/4919265#M104342</link>
      <description>I think I understood it now :)))</description>
      <pubDate>Tue, 23 Aug 2005 17:04:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pthread-includes-trouble-with-gcc/m-p/4919265#M104342</guid>
      <dc:creator>Florian Heigl (new acc)</dc:creator>
      <dc:date>2005-08-23T17:04:40Z</dc:date>
    </item>
  </channel>
</rss>

