[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/18] meson.build: Don't misdetect posix_memalign() on Windows
From: |
Peter Maydell |
Subject: |
[PULL 04/18] meson.build: Don't misdetect posix_memalign() on Windows |
Date: |
Mon, 7 Mar 2022 16:46:55 +0000 |
Currently we incorrectly think that posix_memalign() exists on
Windows. This is because of a combination of:
* the msys2/mingw toolchain/libc claim to have a
__builtin_posix_memalign when there isn't a builtin of that name
* meson will assume that if you have a __builtin_foo that
counts for has_function('foo')
Specifying a specific include file via prefix: causes meson to not
treat builtins as sufficient and actually look for the function
itself; see this meson pull request which added that as the official
way to get the right answer:
https://github.com/mesonbuild/meson/pull/1150
Currently this misdectection doesn't cause problems because we only
use CONFIG_POSIX_MEMALIGN in oslib-posix.c; however that will change
in a following commit.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220226180723.1706285-6-peter.maydell@linaro.org
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
meson.build | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 038502714ab..b541506c1c5 100644
--- a/meson.build
+++ b/meson.build
@@ -1619,7 +1619,9 @@ config_host_data.set('CONFIG_CLOCK_ADJTIME',
cc.has_function('clock_adjtime'))
config_host_data.set('CONFIG_DUP3', cc.has_function('dup3'))
config_host_data.set('CONFIG_FALLOCATE', cc.has_function('fallocate'))
config_host_data.set('CONFIG_POSIX_FALLOCATE',
cc.has_function('posix_fallocate'))
-config_host_data.set('CONFIG_POSIX_MEMALIGN',
cc.has_function('posix_memalign'))
+# Note that we need to specify prefix: here to avoid incorrectly
+# thinking that Windows has posix_memalign()
+config_host_data.set('CONFIG_POSIX_MEMALIGN',
cc.has_function('posix_memalign', prefix: '#include <stdlib.h>'))
config_host_data.set('CONFIG_PPOLL', cc.has_function('ppoll'))
config_host_data.set('CONFIG_PREADV', cc.has_function('preadv', prefix:
'#include <sys/uio.h>'))
config_host_data.set('CONFIG_SEM_TIMEDWAIT', cc.has_function('sem_timedwait',
dependencies: threads))
--
2.25.1
- [PULL 00/18] target-arm queue, Peter Maydell, 2022/03/07
- [PULL 01/18] util: Make qemu_oom_check() a static function, Peter Maydell, 2022/03/07
- [PULL 02/18] util: Unify implementations of qemu_memalign(), Peter Maydell, 2022/03/07
- [PULL 03/18] util: Return valid allocation for qemu_try_memalign() with zero size, Peter Maydell, 2022/03/07
- [PULL 05/18] util: Share qemu_try_memalign() implementation between POSIX and Windows, Peter Maydell, 2022/03/07
- [PULL 04/18] meson.build: Don't misdetect posix_memalign() on Windows,
Peter Maydell <=
- [PULL 07/18] util: Put qemu_vfree() in memalign.c, Peter Maydell, 2022/03/07
- [PULL 06/18] util: Use meson checks for valloc() and memalign() presence, Peter Maydell, 2022/03/07
- [PULL 09/18] target/arm/translate-neon: UNDEF if VLD1/VST1 stride bits are non-zero, Peter Maydell, 2022/03/07
- [PULL 08/18] osdep: Move memalign-related functions to their own header, Peter Maydell, 2022/03/07
- [PULL 10/18] target/arm/translate-neon: Simplify align field check for VLD3, Peter Maydell, 2022/03/07
- [PULL 11/18] hw/intc/arm_gicv3_its: Add trace events for commands, Peter Maydell, 2022/03/07
- [PULL 12/18] hw/intc/arm_gicv3_its: Add trace events for table reads and writes, Peter Maydell, 2022/03/07
- [PULL 13/18] hw/intc/arm_gicv3: Specify valid and impl in MemoryRegionOps, Peter Maydell, 2022/03/07
- [PULL 14/18] hw/intc/arm_gicv3: Fix missing spaces in error log messages, Peter Maydell, 2022/03/07
- [PULL 15/18] hw/intc/arm_gicv3_cpuif: Fix register names in ICV_HPPIR read trace event, Peter Maydell, 2022/03/07