bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] m4: fix gl_TIMER_TIME() detection of threads on uClibc


From: Eric Blake
Subject: Re: [PATCH] m4: fix gl_TIMER_TIME() detection of threads on uClibc
Date: Fri, 21 Feb 2014 17:08:18 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

On 02/21/2014 04:41 PM, Thomas Petazzoni wrote:
> The timer_time.m4 gl_TIMER_TIME function determines which libraries
> need to be linked to get access to the timer function, generally -lrt
> for Linux systems. On platforms where threads are used, librt
> typically uses thread functions from libpthread.
> 
> However, the test to determine whether the platform has thread or not
> is incorrect: it assumes that if the C library is uClibc, then threads
> are not available. This is actually not true: uClibc has configurable
> thread support, and when thread support is available, librt calls
> libpthread functions.
> 
> This is important when static linking is used, because otherwise only
> -lrt is used at link time, which fails because librt calls undefined
> thread functions. Both -lrt and -lpthread must be passed.
> 
> This problem is fixed by making the uClibc thread detection a bit
> smarter, thanks to the usage of the __HAS_NO_THREADS__ macro defined
> in <bits/uClibc_config.h>, which itself is included by <features.h>.

Seems reasonable, so I'm pushing it.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]