This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: libstdc++ wants clock_gettime without libpthread
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: libc-alpha at sourceware dot org, Paolo Carlini <paolo dot carlini at oracle dot com>, Benjamin Kosnik <bkoz at redhat dot com>
- Date: Fri, 19 Oct 2012 07:50:25 +0530
- Subject: Re: libstdc++ wants clock_gettime without libpthread
- References: <CAH6eHdQRyTgkXE7k+UVpaObNTOZf7QF_fNoU-bqbMhfzXxXUDg@mail.gmail.com>
On Thu, 18 Oct 2012 21:09:51 +0100, Jonathan wrote:
> But using clock_gettime() requires libstdc++.so to link to librt.so
> which also pulls in libpthread.so, which causes GCC's
> __gthread_active_p() function to report the program is multithreaded,
> causing libstdc++'s reference counting to use atomic ops.
>
> This means that when configuring libstdc++ you have to choose between
> a low-resolution clock or a performance penalty for single-threaded
> C++ programs.
>
> Is there any possibility glibc could be changed so we could use
> clock_gettime() without causing a dependency on libpthread.so?
There's a related bugzilla for this:
http://sourceware.org/bugzilla/show_bug.cgi?id=14304
so anyone fixing this should close that bug.
Siddhesh