qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 54/66] add a header file for atomic operations


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 54/66] add a header file for atomic operations
Date: Mon, 21 Oct 2013 07:06:14 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9

Il 20/10/2013 17:20, Peter Maydell ha scritto:
>   CC    util/qemu-thread-posix.o
> util/qemu-thread-posix.c:351:13: warning: implicit declaration of
> function '__sync_exchange' is invalid in
>       C99 [-Wimplicit-function-declaration]
>         if (atomic_xchg(&ev->value, EV_SET) == EV_BUSY) {
>             ^
> /Users/pm215/src/qemu/include/qemu/atomic.h:179:32: note: expanded
> from macro 'atomic_xchg'
> #define atomic_xchg(ptr, i)    __sync_exchange(ptr, i)
>                                ^

That's a typo/thinko, it should be __sync_swap according to the
documentation.

> 1 warning generated.
>   LINK  qemu-nbd
> Undefined symbols for architecture x86_64:
>   "___sync_exchange", referenced from:
>       _qemu_event_set in libqemuutil.a(qemu-thread-posix.o)
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see 
> invocation)
> make: *** [qemu-nbd] Error 1
> 
> It looks like we need to select the '#else' case for MacOSX...
> any suggestions about how best to do that?

Or just the #elif if __sync_swap works.

Paolo



reply via email to

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