qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Cc: "qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"David Gibson" <david@gibson.dropbear.id.au>,
	"Richard Henderson" <rth@twiddle.net>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH RFC] configure: fix clang failure for libatomic
Date: Tue, 25 Apr 2017 10:04:54 +0100	[thread overview]
Message-ID: <CAFEAcA9S+q8FiZ2chaLoUWmQJ3uForGaDVGqwrBHnxmpH4sy_Q@mail.gmail.com> (raw)
In-Reply-To: <87pog0q2xz.fsf@abhimanyu.i-did-not-set--mail-host-address--so-tickle-me>

On 25 April 2017 at 09:58, Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> 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 ?

thanks
-- PMM

  reply	other threads:[~2017-04-25  9:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-25  8:35 [Qemu-devel] [PATCH RFC] configure: fix clang failure for libatomic Nikunj A Dadhania
2017-04-25  8:42 ` Peter Maydell
2017-04-25  8:58   ` Nikunj A Dadhania
2017-04-25  9:04     ` Peter Maydell [this message]
2017-04-25  9:16       ` Nikunj A Dadhania
2017-04-25  9:32         ` Peter Maydell
2017-04-25  9:41 ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFEAcA9S+q8FiZ2chaLoUWmQJ3uForGaDVGqwrBHnxmpH4sy_Q@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=nikunj@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).