[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/21] osdep: Avoid using Clang-specific __builtin_available()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 12/21] osdep: Avoid using Clang-specific __builtin_available() |
Date: |
Tue, 15 Mar 2022 13:53:41 +0100 |
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Remove the Clang specific __builtin_available() to allow building
with GCC, otherwise we get:
include/qemu/osdep.h: In function 'qemu_thread_jit_write':
include/qemu/osdep.h:787:9: warning: implicit declaration of function
'__builtin_available'; did you mean '__builtin_scalbl'?
[-Wimplicit-function-declaration]
787 | if (__builtin_available(macOS 11.0, *)) {
| ^~~~~~~~~~~~~~~~~~~
| __builtin_scalbl
include/qemu/osdep.h:787:9: warning: nested extern declaration of
'__builtin_available' [-Wnested-externs]
include/qemu/osdep.h:787:29: error: 'macOS' undeclared (first use in this
function)
787 | if (__builtin_available(macOS 11.0, *)) {
| ^~~~~
include/qemu/osdep.h:787:29: note: each undeclared identifier is reported
only once for each function it appears in
include/qemu/osdep.h:787:34: error: expected ')' before numeric constant
787 | if (__builtin_available(macOS 11.0, *)) {
| ~ ^~~~~
| )
Beside, on macOS Catalina we get 2254 times:
include/qemu/osdep.h:780:5: warning: 'pthread_jit_write_protect_np' is only
available on macOS 11.0 or newer [-Wunguarded-availability-new]
pthread_jit_write_protect_np(true);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fix by using a stricker toolchain version low range, replacing
MAC_OS_X_VERSION_MAX_ALLOWED by MAC_OS_X_VERSION_MIN_REQUIRED.
Reviewed-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Tested-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
include/qemu/osdep.h | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index c9ec7830c9..322103aadb 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -624,19 +624,15 @@ size_t qemu_get_host_physmem(void);
* for the current thread.
*/
#if defined(MAC_OS_VERSION_11_0) && \
- MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0
+ MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_VERSION_11_0
static inline void qemu_thread_jit_execute(void)
{
- if (__builtin_available(macOS 11.0, *)) {
- pthread_jit_write_protect_np(true);
- }
+ pthread_jit_write_protect_np(true);
}
static inline void qemu_thread_jit_write(void)
{
- if (__builtin_available(macOS 11.0, *)) {
- pthread_jit_write_protect_np(false);
- }
+ pthread_jit_write_protect_np(false);
}
#else
static inline void qemu_thread_jit_write(void) {}
--
2.34.1
- [PULL 02/21] tests/fp/berkeley-testfloat-3: Ignore ignored #pragma directives, (continued)
- [PULL 02/21] tests/fp/berkeley-testfloat-3: Ignore ignored #pragma directives, Philippe Mathieu-Daudé, 2022/03/15
- [PULL 03/21] hvf: Use standard CR0 and CR4 register definitions, Philippe Mathieu-Daudé, 2022/03/15
- [PULL 04/21] hvf: Make hvf_get_segments() / hvf_put_segments() local, Philippe Mathieu-Daudé, 2022/03/15
- [PULL 05/21] hvf: Remove deprecated hv_vcpu_flush() calls, Philippe Mathieu-Daudé, 2022/03/15
- [PULL 06/21] block/file-posix: Remove a deprecation warning on macOS 12, Philippe Mathieu-Daudé, 2022/03/15
- [PULL 07/21] audio/coreaudio: Remove a deprecation warning on macOS 12, Philippe Mathieu-Daudé, 2022/03/15
- [PULL 08/21] audio/dbus: Fix building with modules on macOS, Philippe Mathieu-Daudé, 2022/03/15
- [PULL 09/21] audio: Log context for audio bug, Philippe Mathieu-Daudé, 2022/03/15
- [PULL 10/21] coreaudio: Always return 0 in handle_voice_change, Philippe Mathieu-Daudé, 2022/03/15
- [PULL 11/21] audio: Rename coreaudio extension to use Objective-C compiler, Philippe Mathieu-Daudé, 2022/03/15
- [PULL 12/21] osdep: Avoid using Clang-specific __builtin_available(),
Philippe Mathieu-Daudé <=
- [PULL 13/21] meson: Resolve the entitlement.sh script once for good, Philippe Mathieu-Daudé, 2022/03/15
- [PULL 14/21] meson: Log QEMU_CXXFLAGS content in summary, Philippe Mathieu-Daudé, 2022/03/15
- [PULL 15/21] configure: Pass filtered QEMU_OBJCFLAGS to meson, Philippe Mathieu-Daudé, 2022/03/15
- [PULL 16/21] ui/cocoa: Constify qkeycode translation arrays, Philippe Mathieu-Daudé, 2022/03/15
- [PULL 17/21] ui/cocoa: add option to disable left-command forwarding to guest, Philippe Mathieu-Daudé, 2022/03/15
- [PULL 18/21] ui/cocoa: release mouse when user switches away from QEMU window, Philippe Mathieu-Daudé, 2022/03/15
- [PULL 19/21] ui/cocoa: capture all keys and combos when mouse is grabbed, Philippe Mathieu-Daudé, 2022/03/15
- [PULL 20/21] ui/cocoa: add option to swap Option and Command, Philippe Mathieu-Daudé, 2022/03/15
- [PULL 21/21] MAINTAINERS: Volunteer to maintain Darwin-based hosts support, Philippe Mathieu-Daudé, 2022/03/15
- Re: [PULL 00/21] Darwin patches for 2022-03-15, Peter Maydell, 2022/03/15