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

Re: [libvirt] [PATCH 3/1] build: work with glibc that lacks CPU_COUNT

On 08/21/2012 12:39 PM, Daniel P. Berrange wrote:
> On Tue, Aug 21, 2012 at 11:17:21AM -0600, Eric Blake wrote:
>> Building on RHEL 5 warned:
>> nodeinfo.c: 305: warning: implicit declaration of function 'CPU_COUNT'
>> This extension macro in <sched.h> was not added until later glibc.
>> * src/nodeinfo.c (CPU_COUNT): Add fallback implementation.
>> ---
>> Pushing under the build-breaker rule.  I'm still getting link
>> failures:
>> ./.libs/libvirt_util.a(libvirt_util_la-virobject.o): In function `virAtomicIntXor':
>> /home/dummy/l,ibvirt/src/util/viratomoic.h:404: multiple definition of `virAtomicIntXor'
>> ./.libs/libvirt_util.a(libvirt_util_la-viratomic.o):/home/dummy/libvirt/src/util/viratomic.h:404: first defined here
> Hmm, that seems to suggested that when viratomic.c #includes
> viratomic.h, GCC is instantiating the functions, even though
> they're declared inline.

Yep, we declared them 'inline' (which means they still have an eternal
address), not 'static inline' (which means don't emit, if possible) or
even '__attribute__((__gnu_inline__))' (which means don't emit, ever).
We don't see it on modern Fedora or RHEL (gcc intrinsics work); I'm not
sure why mingw isn't seeing it, but RHEL 5 is seeing it because it falls
back to the pthread implementation.  I'm testing a patch now...

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

Attachment: signature.asc
Description: OpenPGP digital signature

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