qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH RFC] configure: fix clang failure for libatomic


From: Nikunj A Dadhania
Subject: Re: [Qemu-devel] [PATCH RFC] configure: fix clang failure for libatomic
Date: Tue, 25 Apr 2017 14:46:17 +0530
User-agent: Notmuch/0.23.5 (https://notmuchmail.org) Emacs/25.1.1 (x86_64-redhat-linux-gnu)

Peter Maydell <address@hidden> writes:

> On 25 April 2017 at 09:58, Nikunj A Dadhania <address@hidden> wrote:
>> I was trying out the program in the configure script with clang and I do
>> get errors without libatomic:
>>
>>     $ clang /tmp/atomic.c
>>     /tmp/atomic.c:6:7: warning: implicit declaration of function 
>> '__atomic_load_8' is invalid in C99 [-Wimplicit-function-declaration]
>>       y = __atomic_load_8(&x, 0);
>>           ^
>>     /tmp/atomic.c:7:3: warning: implicit declaration of function 
>> '__atomic_store_8' is invalid in C99 [-Wimplicit-function-declaration]
>>       __atomic_store_8(&x, y, 0);
>>       ^
>>     /tmp/atomic.c:8:3: warning: implicit declaration of function 
>> '__atomic_compare_exchange_8' is invalid in C99 
>> [-Wimplicit-function-declaration]
>>       __atomic_compare_exchange_8(&x, &y, x, 0, 0, 0);
>>       ^
>>     /tmp/atomic.c:9:3: warning: implicit declaration of function 
>> '__atomic_exchange_8' is invalid in C99 [-Wimplicit-function-declaration]
>>       __atomic_exchange_8(&x, y, 0);
>>       ^
>>     /tmp/atomic.c:10:3: warning: implicit declaration of function 
>> '__atomic_fetch_add_8' is invalid in C99 [-Wimplicit-function-declaration]
>>       __atomic_fetch_add_8(&x, y, 0);
>>       ^
>>     5 warnings generated.
>>     /tmp/atomic-1660e0.o: In function `main':
>>     /tmp/atomic.c:(.text+0x28): undefined reference to `__atomic_load_8'
>>     /tmp/atomic.c:(.text+0x40): undefined reference to `__atomic_store_8'
>>     /tmp/atomic.c:(.text+0x69): undefined reference to 
>> `__atomic_compare_exchange_8'
>>     /tmp/atomic.c:(.text+0x7d): undefined reference to `__atomic_exchange_8'
>>     /tmp/atomic.c:(.text+0x91): undefined reference to `__atomic_fetch_add_8'
>>     clang-3.9: error: linker command failed with exit code 1 (use -v to see 
>> invocation)
>>
>> With -latomic, the linker succeeds in getting the binary.
>
> What host is this on ?

$ uname -a
Linux abhimanyu 4.9.13-200.fc25.x86_64 #1 SMP Mon Feb 27 16:48:42 UTC 2017 
x86_64 x86_64 x86_64 GNU/Linux
$

Regards
Nikunj




reply via email to

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