meson: ensure -mcx16 is passed when detecting ATOMIC128
Moving -mcx16 out of CPU_CFLAGS caused the detection of ATOMIC128 to fail, because flags have to be specified by hand in cc.compiles and cc.links invocations (why oh why??). Ensure that these tests enable all the instruction set extensions that will be used to build the emulators. Fixes: c2bf2ccb266 ("configure: move -mcx16 flag out of CPU_CFLAGS", 2024-05-24) Reported-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Tested-by: Alex Bennée <alex.bennee@linaro.org> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> (cherry picked from commit 8db4e0f92e83fd80b6609439440b303ddded7ad8) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
22359e0e6e
commit
997f8d5c2b
@ -2795,7 +2795,7 @@ config_host_data.set('CONFIG_ATOMIC64', cc.links('''
|
|||||||
__atomic_exchange_n(&x, y, __ATOMIC_RELAXED);
|
__atomic_exchange_n(&x, y, __ATOMIC_RELAXED);
|
||||||
__atomic_fetch_add(&x, y, __ATOMIC_RELAXED);
|
__atomic_fetch_add(&x, y, __ATOMIC_RELAXED);
|
||||||
return 0;
|
return 0;
|
||||||
}'''))
|
}''', args: qemu_isa_flags))
|
||||||
|
|
||||||
has_int128_type = cc.compiles('''
|
has_int128_type = cc.compiles('''
|
||||||
__int128_t a;
|
__int128_t a;
|
||||||
@ -2829,7 +2829,7 @@ if has_int128_type
|
|||||||
__atomic_compare_exchange_n(&p[4], &p[5], p[6], 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
|
__atomic_compare_exchange_n(&p[4], &p[5], p[6], 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
|
||||||
return 0;
|
return 0;
|
||||||
}'''
|
}'''
|
||||||
has_atomic128 = cc.links(atomic_test_128)
|
has_atomic128 = cc.links(atomic_test_128, args: qemu_isa_flags)
|
||||||
|
|
||||||
config_host_data.set('CONFIG_ATOMIC128', has_atomic128)
|
config_host_data.set('CONFIG_ATOMIC128', has_atomic128)
|
||||||
|
|
||||||
@ -2838,7 +2838,8 @@ if has_int128_type
|
|||||||
# without optimization enabled. Try again with optimizations locally
|
# without optimization enabled. Try again with optimizations locally
|
||||||
# enabled for the function. See
|
# enabled for the function. See
|
||||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107389
|
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107389
|
||||||
has_atomic128_opt = cc.links('__attribute__((optimize("O1")))' + atomic_test_128)
|
has_atomic128_opt = cc.links('__attribute__((optimize("O1")))' + atomic_test_128,
|
||||||
|
args: qemu_isa_flags)
|
||||||
config_host_data.set('CONFIG_ATOMIC128_OPT', has_atomic128_opt)
|
config_host_data.set('CONFIG_ATOMIC128_OPT', has_atomic128_opt)
|
||||||
|
|
||||||
if not has_atomic128_opt
|
if not has_atomic128_opt
|
||||||
@ -2849,7 +2850,7 @@ if has_int128_type
|
|||||||
__sync_val_compare_and_swap_16(&x, y, x);
|
__sync_val_compare_and_swap_16(&x, y, x);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
'''))
|
''', args: qemu_isa_flags))
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user