Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Nov 2020 15:40:06 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 251112] Compiling C++ with asan fails by default because libclang_rt.asan-x86_64.so uses symbol pthread_attr_get_np but doesn't link to libpthread.so
Message-ID:  <bug-251112-227-7x0SVvRX1Q@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-251112-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-251112-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | previous in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=251112

--- Comment #5 from Andrew Stitcher <astitcher@apache.org> ---
(In reply to Konstantin Belousov from comment #4)

I'm not sure I really understand what you mean about linking with libpthread.so
changing the behaviour of libc.so. Most of the FreeBSD pthread calls are
already in libc (or at least don't need to explicitly link with -lpthread
according to the manpage).

So I expected that libc is already multithreaded and linking in pthread is only
used for the _np (non portable/posix) pthread calls.

Looking at the clang source code pthread_attr_get_np is used to get the stack
parameters (pthread_getattr_np is #defined to pthread_attr_get_np):

  pthread_attr_t attr;
  pthread_attr_init(&attr);
  CHECK_EQ(pthread_getattr_np(pthread_self(), &attr), 0);
  my_pthread_attr_getstack(&attr, &stackaddr, &stacksize);
  pthread_attr_destroy(&attr);

I'm not sure how relevant this is to what you're interested in, but the symbol
is used to call a function.

-- 
You are receiving this mail because:
You are the assignee for the bug.

help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-251112-227-7x0SVvRX1Q>