From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VY8dS-00013l-2K for qemu-devel@nongnu.org; Mon, 21 Oct 2013 02:06:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VY8dF-0001Pp-St for qemu-devel@nongnu.org; Mon, 21 Oct 2013 02:06:37 -0400 Received: from mail-wg0-x229.google.com ([2a00:1450:400c:c00::229]:32860) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VY8dF-0001PU-Lo for qemu-devel@nongnu.org; Mon, 21 Oct 2013 02:06:25 -0400 Received: by mail-wg0-f41.google.com with SMTP id b13so4166879wgh.4 for ; Sun, 20 Oct 2013 23:06:24 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <5264C456.9040404@redhat.com> Date: Mon, 21 Oct 2013 07:06:14 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1372950842-32422-1-git-send-email-pbonzini@redhat.com> <1372950842-32422-55-git-send-email-pbonzini@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 54/66] add a header file for atomic operations List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers 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