qemu-e2k/include/qemu
Thomas Huth 34aee9c946 host/include/generic/host/atomic128: Fix compilation problem with Clang 17
When compiling QEMU with Clang 17 on a s390x, the compilation fails:

In file included from ../accel/tcg/cputlb.c:32:
In file included from /root/qemu/include/exec/helper-proto-common.h:10:
In file included from /root/qemu/include/qemu/atomic128.h:62:
/root/qemu/host/include/generic/host/atomic128-ldst.h:68:15: error:
 __sync builtin operation MUST have natural alignment (consider using __
atomic). [-Werror,-Wsync-alignment]
   68 |     } while (!__sync_bool_compare_and_swap_16(ptr_align, old, new.i));
      |               ^
In file included from ../accel/tcg/cputlb.c:32:
In file included from /root/qemu/include/exec/helper-proto-common.h:10:
In file included from /root/qemu/include/qemu/atomic128.h:61:
/root/qemu/host/include/generic/host/atomic128-cas.h:36:11: error:
 __sync builtin operation MUST have natural alignment (consider using __a
tomic). [-Werror,-Wsync-alignment]
   36 |     r.i = __sync_val_compare_and_swap_16(ptr_align, c.i, n.i);
      |           ^
2 errors generated.

It's arguably a bug in Clang since we already use __builtin_assume_aligned()
to tell the compiler that the pointer is properly aligned. But according to
https://github.com/llvm/llvm-project/issues/69146 it seems like the Clang
folks don't see an easy fix on their side and recommend to use a type
declared with __attribute__((aligned(16))) to work around this problem.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1934
Message-ID: <20231108085954.313071-1-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-11-13 11:35:47 +01:00
..
accel.h accel: Declare AccelClass::cpu_common_[un]realize() handlers 2023-10-03 08:00:25 -07:00
async-teardown.h Don't include headers already included by qemu/osdep.h 2023-02-08 07:28:05 +01:00
atomic128.h tcg: Correct invalid mentions of 'softmmu' by 'system-mode' 2023-10-07 19:02:33 +02:00
atomic.h qobject atomics osdep: Make a few macros more hygienic 2023-09-29 08:13:57 +02:00
base64.h
bcd.h
bitmap.h replace TABs with spaces 2023-03-20 12:43:50 +01:00
bitops.h qemu/bitops.h: Limit rotate amounts 2023-05-02 12:36:46 -07:00
bswap.h bswap: Add the ability to store to an unaligned 24 bit field 2023-06-22 18:55:14 -04:00
buffer.h Replace GCC_FMT_ATTR with G_GNUC_PRINTF 2022-03-22 14:40:51 +04:00
cacheflush.h
cacheinfo.h
clang-tsa.h clang-tsa: Add macros for shared locks 2022-12-15 16:07:43 +01:00
co-shared-resource.h
compiler.h meson: do not use set10 2023-10-17 15:20:53 +02:00
config-file.h qemu-config: Make config_parse_qdict() return bool 2022-12-14 16:19:35 +01:00
coroutine_int.h
coroutine-core.h coroutine: Split qemu/coroutine-core.h off qemu/coroutine.h 2023-01-20 07:21:46 +01:00
coroutine-tls.h
coroutine.h coroutine: Split qemu/coroutine-core.h off qemu/coroutine.h 2023-01-20 07:21:46 +01:00
cpu-float.h Clean up ill-advised or unusual header guards 2022-05-11 16:50:01 +02:00
cpuid.h host/include/i386: Implement clmul.h 2023-09-15 13:57:00 +00:00
crc32c.h igb: Implement Rx SCTP CSO 2023-05-23 15:20:15 +08:00
crc-ccitt.h bulk: Do not declare function prototypes using 'extern' keyword 2023-08-31 19:47:43 +02:00
ctype.h
cutils.h cutils: Adjust signature of parse_uint[_full] 2023-06-02 12:27:19 -05:00
datadir.h
dbus.h Don't include headers already included by qemu/osdep.h 2023-02-08 07:28:05 +01:00
defer-call.h util/defer-call: move defer_call() to util/ 2023-10-31 15:41:42 +01:00
drm.h
envlist.h remove unnecessary extern "C" blocks 2023-02-10 14:12:06 +01:00
error-report.h Move error_printf_unless_qmp() with monitor unit 2022-04-21 17:09:09 +04:00
event_notifier.h
fifo8.h util/fifo8: Fix typo in fifo8_push_all() description 2023-08-31 19:47:43 +02:00
fifo32.h
filemonitor.h
futex.h
guest-random.h util/guest-random: Clean up global variable shadowing 2023-10-06 13:27:48 +02:00
hbitmap.h hbitmap: fix hbitmap_status() return value for first dirty bit case 2023-02-17 14:34:24 +01:00
help_option.h
help-texts.h Update copyright dates to 2023 2023-05-30 15:50:17 +01:00
host-utils.h host-utils: Add muldiv64_round_up 2023-09-06 11:19:33 +02:00
hw-version.h
id.h
int128.h host/include/generic/host/atomic128: Fix compilation problem with Clang 17 2023-11-13 11:35:47 +01:00
interval-tree.h util: Add interval-tree.c 2022-12-20 17:09:41 -08:00
iov.h util/iov: Remove qemu_iovec_init_extended() 2023-06-05 13:11:24 +02:00
iova-tree.h util: spelling fixes 2023-08-31 19:47:43 +02:00
jhash.h
job.h job: remove unused functions 2022-10-07 12:11:41 +02:00
keyval.h Clean up ill-advised or unusual header guards 2022-05-11 16:50:01 +02:00
lockable.h coroutine: Split qemu/coroutine-core.h off qemu/coroutine.h 2023-01-20 07:21:46 +01:00
log-for-trace.h util/log: Drop return value from qemu_log 2022-04-20 10:51:11 -07:00
log.h util/log: Add vector registers to log 2023-06-13 17:42:01 +10:00
madvise.h
main-loop.h async: Add an optional reentrancy guard to the BH API 2023-04-28 11:31:07 +02:00
memalign.h osdep: Move memalign-related functions to their own header 2022-03-07 13:16:49 +00:00
memfd.h
mmap-alloc.h util/mmap-alloc: qemu_fd_getfs() 2023-04-24 11:29:00 +02:00
module.h module: add Error arguments to module_load and module_load_qom 2022-11-06 09:48:50 +01:00
mprotect.h
notify.h
nvdimm-utils.h
option_int.h
option.h include: add qemu/keyval.h 2022-04-21 17:03:51 +04:00
osdep.h osdep: set _FORTIFY_SOURCE=2 when optimization is enabled 2023-10-04 09:52:06 -04:00
path.h
plugin-event.h include/qemu: Split out plugin-event.h 2023-03-22 15:06:57 +00:00
plugin-memory.h plugin: Simplify struct qemu_plugin_hwaddr 2023-09-16 14:57:15 +00:00
plugin.h plugins/loader: Clean up global variable shadowing 2023-10-06 13:27:48 +02:00
pmem.h
processor.h qemu/processor: Remove unused 'qemu/atomic.h' header 2023-08-31 19:47:43 +02:00
progress_meter.h coroutine: Clean up superfluous inclusion of qemu/lockable.h 2023-01-19 10:18:28 +01:00
qdist.h
qemu-plugin.h plugins: add dllexport and dllimport to api funcs 2023-11-08 15:15:23 +00:00
qemu-print.h Replace GCC_FMT_ATTR with G_GNUC_PRINTF 2022-03-22 14:40:51 +04:00
qemu-progress.h include: move progress API to qemu-progress.h 2022-04-06 14:31:43 +02:00
qht.h
qsp.h
qtree.h util: import GTree as QTree 2023-03-28 15:23:10 -07:00
queue.h
range.h range: Introduce range_inverse_array() 2023-11-03 09:20:31 +01:00
ratelimit.h
rcu_queue.h remove unnecessary extern "C" blocks 2023-02-10 14:12:06 +01:00
rcu.h bulk: Do not declare function prototypes using 'extern' keyword 2023-08-31 19:47:43 +02:00
readline.h readline: Extract readline_add_completion_of() from monitor 2023-02-04 07:56:54 +01:00
reserved-region.h util/reserved-region: Add new ReservedRegion helpers 2023-11-03 09:20:31 +01:00
selfmap.h util/selfmap: Use dev_t and ino_t in MapInfo 2023-09-01 13:34:03 -07:00
seqlock.h
sockets.h osdep: implement qemu_socketpair() for win32 2023-03-13 15:39:31 +04:00
stats64.h stat64: Add stat64_set() operation 2023-04-27 16:39:43 +02:00
sys_membarrier.h bulk: Do not declare function prototypes using 'extern' keyword 2023-08-31 19:47:43 +02:00
systemd.h
thread-context.h util: Introduce ThreadContext user-creatable object 2022-10-27 11:00:43 +02:00
thread-posix.h thread-posix: implement Semaphore with QemuCond and QemuMutex 2022-04-06 14:31:56 +02:00
thread-win32.h
thread.h util/qemu-thread-posix: use TSA_NO_TSA to suppress clang TSA warnings in FreeBSD 2023-02-17 11:22:19 +01:00
throttle-options.h
throttle.h throttle: use enum ThrottleDirection instead of bool is_write 2023-08-29 10:49:24 +02:00
timed-average.h
timer.h qemu/timer: Add host ticks function for RISC-V 2023-09-21 10:39:51 +02:00
transactions.h
tsan.h
typedefs.h accel/tcg: Simplify tlb_plugin_lookup 2023-09-16 14:57:15 +00:00
unicode.h
units.h
uri.h bulk: Do not declare function prototypes using 'extern' keyword 2023-08-31 19:47:43 +02:00
userfaultfd.h migration: Clean up includes 2023-02-08 07:27:20 +01:00
uuid.h util/uuid: Define UUID_STR_LEN from UUID_NONE string 2023-11-03 09:20:31 +01:00
vfio-helpers.h
vhost-user-server.h io: follow coroutine AioContext in qio_channel_yield() 2023-09-07 20:32:11 -05:00
win_dump_defs.h include/qemu: add 32-bit Windows dump structures 2022-04-22 13:36:04 +04:00
xattr.h qemu/xattr.h: Exclude <sys/xattr.h> for Windows 2022-12-23 11:48:13 +01:00
xxhash.h accel/tcg: include cs_base in our hash calculations 2023-06-01 11:05:05 -04:00
yank.h util: spelling fixes 2023-08-31 19:47:43 +02:00