From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: manos.pitsidianakis@linaro.org, zhao1.liu@intel.com,
junjie.mao@intel.com, pierrick.bouvier@linaro.org,
alex.bennee@linaro.org
Subject: [PULL 06/12] meson.build: add HAVE_GLIB_WITH_ALIGNED_ALLOC flag
Date: Mon, 7 Oct 2024 13:03:34 +0200 [thread overview]
Message-ID: <20241007110342.1298598-7-pbonzini@redhat.com> (raw)
In-Reply-To: <20241007110342.1298598-1-pbonzini@redhat.com>
From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Rust crates, introduced from the next commit onwards, can optionally use
the glib allocator API and need to know whether g_aligned_alloc etc are
available.
This commit adds a define in config_host_data that depends on glib
version >= 2.72.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Link: https://lore.kernel.org/r/23f7b0cc9801d315f5d7835e30d775e133ec2fb9.1727961605.git.manos.pitsidianakis@linaro.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
meson.build | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index b9a83dfc744..aea419a8317 100644
--- a/meson.build
+++ b/meson.build
@@ -948,7 +948,9 @@ have_xen_pci_passthrough = get_option('xen_pci_passthrough') \
################
# When bumping glib minimum version, please check also whether to increase
-# the _WIN32_WINNT setting in osdep.h according to the value from glib
+# the _WIN32_WINNT setting in osdep.h according to the value from glib.
+# You should also check if any of the glib.version() checks
+# below can also be removed.
glib_req_ver = '>=2.66.0'
glib_pc = dependency('glib-2.0', version: glib_req_ver, required: true,
method: 'pkg-config')
@@ -998,6 +1000,9 @@ glib = declare_dependency(dependencies: [glib_pc, gmodule],
# TODO: remove this check and the corresponding workaround (qtree) when
# the minimum supported glib is >= 2.75.3
glib_has_gslice = glib.version().version_compare('<2.75.3')
+# Check whether glib has the aligned_alloc family of functions.
+# <https://docs.gtk.org/glib/func.aligned_alloc.html>
+glib_has_aligned_alloc = glib.version().version_compare('>=2.72.0')
# override glib dep to include the above refinements
meson.override_dependency('glib-2.0', glib)
@@ -2529,6 +2534,7 @@ config_host_data.set('CONFIG_TIMERFD', cc.has_function('timerfd_create'))
config_host_data.set('HAVE_COPY_FILE_RANGE', cc.has_function('copy_file_range'))
config_host_data.set('HAVE_GETIFADDRS', cc.has_function('getifaddrs'))
config_host_data.set('HAVE_GLIB_WITH_SLICE_ALLOCATOR', glib_has_gslice)
+config_host_data.set('HAVE_GLIB_WITH_ALIGNED_ALLOC', glib_has_aligned_alloc)
config_host_data.set('HAVE_OPENPTY', cc.has_function('openpty', dependencies: util))
config_host_data.set('HAVE_STRCHRNUL', cc.has_function('strchrnul'))
config_host_data.set('HAVE_SYSTEM_FUNCTION', cc.has_function('system', prefix: '#include <stdlib.h>'))
--
2.46.1
next prev parent reply other threads:[~2024-10-07 11:05 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-07 11:03 [PULL 00/12] Rust initial PoC + meson changes for 2024-10-07 Paolo Bonzini
2024-10-07 11:03 ` [PULL 01/12] Require meson version 1.5.0 Paolo Bonzini
2024-10-07 11:03 ` [PULL 02/12] build-sys: Add rust feature option Paolo Bonzini
2024-10-07 11:03 ` [PULL 03/12] configure, meson: detect Rust toolchain Paolo Bonzini
2024-10-07 11:03 ` [PULL 04/12] rust: add bindgen step as a meson dependency Paolo Bonzini
2024-10-07 11:03 ` [PULL 05/12] .gitattributes: add Rust diff and merge attributes Paolo Bonzini
2024-10-07 11:03 ` Paolo Bonzini [this message]
2024-10-07 11:03 ` [PULL 07/12] rust: add crate to expose bindings and interfaces Paolo Bonzini
2024-10-07 11:03 ` [PULL 08/12] rust: add utility procedural macro crate Paolo Bonzini
2024-10-07 11:03 ` [PULL 09/12] rust: add PL011 device model Paolo Bonzini
2024-10-07 11:03 ` [PULL 10/12] meson: fix machine option for x86_version Paolo Bonzini
2024-10-07 11:03 ` [PULL 11/12] meson: define qemu_isa_flags Paolo Bonzini
2024-10-07 11:03 ` [PULL 12/12] meson: ensure -mcx16 is passed when detecting ATOMIC128 Paolo Bonzini
2024-10-07 11:11 ` [PULL 00/12] Rust initial PoC + meson changes for 2024-10-07 Daniel P. Berrangé
2024-10-07 11:26 ` Paolo Bonzini
2024-10-07 11:47 ` Daniel P. Berrangé
2024-10-07 11:52 ` Daniel P. Berrangé
2024-10-07 15:51 ` Paolo Bonzini
2024-10-07 17:56 ` Brian Cain
2024-10-07 19:15 ` Paolo Bonzini
2024-10-08 3:27 ` Brian Cain
2024-10-08 3:39 ` Pierrick Bouvier
2024-10-08 10:01 ` Alex Bennée
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=20241007110342.1298598-7-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=junjie.mao@intel.com \
--cc=manos.pitsidianakis@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=zhao1.liu@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).