From: Akihiko Odaki <akihiko.odaki@daynix.com>
To: qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Eric Blake" <eblake@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
devel@daynix.com, "Akihiko Odaki" <akihiko.odaki@daynix.com>
Subject: [PATCH 1/4] meson: Use has_header_symbol() to check getcpu()
Date: Thu, 24 Apr 2025 13:50:11 +0900 [thread overview]
Message-ID: <20250424-buildsys-v1-1-97655e3b25d7@daynix.com> (raw)
In-Reply-To: <20250424-buildsys-v1-0-97655e3b25d7@daynix.com>
The use of gnu_source_prefix in the detection of getcpu() was
ineffective because the header file that declares getcpu() when
_GNU_SOURCE is defined was not included. Pass sched.h to
has_header_symbol() so that the existence of the declaration will be
properly checked.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
meson.build | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 41f68d38069b..c0ecb6feab77 100644
--- a/meson.build
+++ b/meson.build
@@ -2635,7 +2635,6 @@ 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_GETCPU', cc.has_function('getcpu', prefix: gnu_source_prefix))
config_host_data.set('CONFIG_SCHED_GETCPU', cc.has_function('sched_getcpu', prefix: '#include <sched.h>'))
# Note that we need to specify prefix: here to avoid incorrectly
# thinking that Windows has posix_memalign()
@@ -2713,6 +2712,8 @@ config_host_data.set('CONFIG_FALLOCATE_ZERO_RANGE',
config_host_data.set('CONFIG_FIEMAP',
cc.has_header('linux/fiemap.h') and
cc.has_header_symbol('linux/fs.h', 'FS_IOC_FIEMAP'))
+config_host_data.set('CONFIG_GETCPU',
+ cc.has_header_symbol('sched.h', 'getcpu', prefix: gnu_source_prefix))
config_host_data.set('CONFIG_GETRANDOM',
cc.has_function('getrandom') and
cc.has_header_symbol('sys/random.h', 'GRND_NONBLOCK'))
--
2.49.0
next prev parent reply other threads:[~2025-04-24 4:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-24 4:50 [PATCH 0/4] meson: Use osdep_prefix for strchrnul() Akihiko Odaki
2025-04-24 4:50 ` Akihiko Odaki [this message]
2025-04-24 6:47 ` [PATCH 1/4] meson: Use has_header_symbol() to check getcpu() Philippe Mathieu-Daudé
2025-04-24 4:50 ` [PATCH 2/4] meson: Remove CONFIG_STATX and CONFIG_STATX_MNT_ID Akihiko Odaki
2025-04-24 6:50 ` Philippe Mathieu-Daudé
2025-04-24 4:50 ` [PATCH 3/4] meson: Share common C source prefixes Akihiko Odaki
2025-04-24 6:45 ` Philippe Mathieu-Daudé
2025-04-24 4:50 ` [PATCH 4/4] meson: Use osdep_prefix for strchrnul() Akihiko Odaki
2025-04-24 6:46 ` Philippe Mathieu-Daudé
2025-04-25 10:52 ` [PATCH 0/4] " Philippe Mathieu-Daudé
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=20250424-buildsys-v1-1-97655e3b25d7@daynix.com \
--to=akihiko.odaki@daynix.com \
--cc=berrange@redhat.com \
--cc=devel@daynix.com \
--cc=eblake@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).