All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>,
	Cole Robinson <crobinso@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: clang build error on i686
Date: Sun, 11 Jul 2021 08:17:49 -0700	[thread overview]
Message-ID: <aa6e3eba-1cbd-1951-2811-36856b3a1816@linaro.org> (raw)
In-Reply-To: <CAFEAcA_jRNB=b2FS+9yrYX6r5YcnT0n9ooDH5Bnskzn9PwSKhw@mail.gmail.com>

On 7/3/21 10:45 AM, Peter Maydell wrote:
> On Sat, 3 Jul 2021 at 15:37, Cole Robinson <crobinso@redhat.com> wrote:
>>
>> Hi, I'm hitting build errors with clang on i686 userspace on x86_64
>> kernel. Affects both qemu 6.0.0 and qemu.git, tested with fedora
>> clang-12.0.1~rc3-1.fc35.i686.
>>
>> Full build log from the 6.0.0 build:
>> https://gist.githubusercontent.com/crobinso/7b1206044eac7326490b2adce829e861/raw/9dddef968051fd6383ba7adb9e595081ad4f8fa4/gistfile1.txt
>>
>> Lots of errors like:
>>
>> /usr/bin/ld: libqemu-aarch64-softmmu.fa.p/accel_tcg_cputlb.c.o: in
>> function `helper_atomic_cmpxchgq_le_mmu':
>> /builddir/build/BUILD/qemu-6.0.0/accel/tcg/atomic_template.h:86:
>> undefined reference to `__atomic_compare_exchange_8'
>> /usr/bin/ld: libqemu-aarch64-softmmu.fa.p/accel_tcg_cputlb.c.o: in
>> function `helper_atomic_xchgq_le_mmu':
>> /builddir/build/BUILD/qemu-6.0.0/accel/tcg/atomic_template.h:134:
>> undefined reference to `__atomic_exchange_8'
>>
>> Also warnings like:
>>
>> /builddir/build/BUILD/qemu-6.0.0/include/qemu/stats64.h:58:21: warning:
>> misaligned atomic operation may incur significant performance penalty;
>> the expected alignment (8 bytes) exceeds the actual alignment (4 bytes)
>> [-Watomic-alignment]
>>      uint64_t orig = qatomic_read__nocheck(&s->value);
>>                      ^
>> /builddir/build/BUILD/qemu-6.0.0/include/qemu/atomic.h:129:5: note:
>> expanded from macro 'qatomic_read__nocheck'
>>      __atomic_load_n(ptr, __ATOMIC_RELAXED)
> 
> I think at least part of what is happening here is that this compiler/host
> doesn't support native 64-bit atomics, but configure has selected
> CONFIG_ATOMIC64 anyway.

Not true.  The host certainly supports it.

This is a new alignment warning in clang-12 wrt the alignment of the atomic operation. 
Which may be complicated by the fact that the i386 abi does not normally align structures 
beyond 4 bytes.

We may need to disable this warning for i386 (but not x86_64).


r~


  reply	other threads:[~2021-07-11 15:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-03 14:34 clang build error on i686 Cole Robinson
2021-07-03 16:20 ` Philippe Mathieu-Daudé
2021-07-03 16:27   ` Philippe Mathieu-Daudé
2021-07-03 16:25 ` Philippe Mathieu-Daudé
2021-07-03 17:45 ` Peter Maydell
2021-07-11 15:17   ` Richard Henderson [this message]
2021-07-11 17:50     ` Peter Maydell
2021-07-12 16:10       ` 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=aa6e3eba-1cbd-1951-2811-36856b3a1816@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=crobinso@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.