This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Linking with -pthread only if linking with a .so that needs it
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: Sam Varshavchik <mrsam at courier-mta dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 30 Apr 2018 19:37:50 +0200
- Subject: Re: Linking with -pthread only if linking with a .so that needs it
- References: <cone.1524568489.613900.60547.1004@monster.email-scan.com>
* Sam Varshavchik:
> libcxx.so gets built by gcc.7.3.1 with -std=c++17 -O2
> -fvisibility-inlines- hidden, -fno-omit-frame-pointer, and
> -pthread. It contains some static variables that are instantiated
> templates. It contains other static variables whose constructors
> invoke the instantiated templates' methods that construct and
> destruct std::unique_lock<std::mutex> of std::mutexes that are
> static variables of the instantiated templates. Static
> initialization of libcxx.so does not create any execution thread.
What's the binding type for __pthread_key_create in libcxx.so? I
assume that's the symbol used as a key for __gthread_active_p.