From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Thomas Huth" <thuth@redhat.com>, "Ed Maste" <emaste@freebsd.org>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
"Willian Rampazzo" <willianr@redhat.com>,
"Yonggang Luo" <luoyonggang@gmail.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Li-Wen Hsu" <lwhsu@freebsd.org>
Subject: [PATCH 1/3] build: validate that system capstone works before using it
Date: Fri, 25 Jun 2021 18:22:09 +0100 [thread overview]
Message-ID: <20210625172211.451010-2-berrange@redhat.com> (raw)
In-Reply-To: <20210625172211.451010-1-berrange@redhat.com>
Some versions of capstone have shipped a broken pkg-config file which
puts the -I path without the trailing '/capstone' suffix. This breaks
the ability to "#include <capstone.h>". Upstream and most distros have
fixed this, but a few stragglers remain, notably FreeBSD.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
meson.build | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/meson.build b/meson.build
index d8a92666fb..9979ddae71 100644
--- a/meson.build
+++ b/meson.build
@@ -1425,6 +1425,19 @@ if capstone_opt in ['enabled', 'auto', 'system']
kwargs: static_kwargs, method: 'pkg-config',
required: capstone_opt == 'system' or
capstone_opt == 'enabled' and not have_internal)
+
+ # Some versions of capstone have broken pkg-config file
+ # that reports a wrong -I path, causing the #include to
+ # fail later. If the system has such a broken version
+ # do not use it.
+ if capstone.found() and not cc.compiles('#include <capstone.h>',
+ dependencies: [capstone])
+ capstone = not_found
+ if capstone_opt == 'system'
+ error('system capstone requested, it it does not appear to work')
+ endif
+ endif
+
if capstone.found()
capstone_opt = 'system'
elif have_internal
--
2.31.1
next prev parent reply other threads:[~2021-06-25 17:23 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-25 17:22 [PATCH 0/3] ci: use cirrus-run to utilize Cirrus CI from GitLab CI Daniel P. Berrangé
2021-06-25 17:22 ` Daniel P. Berrangé [this message]
2021-06-28 6:54 ` [PATCH 1/3] build: validate that system capstone works before using it Thomas Huth
2021-06-30 20:54 ` Willian Rampazzo
2021-07-05 12:06 ` Alex Bennée
2021-06-25 17:22 ` [PATCH 2/3] gitlab: support for FreeBSD 12, 13 and macOS 11 via cirrus-run Daniel P. Berrangé
2021-06-28 7:28 ` Thomas Huth
2021-06-28 8:33 ` Daniel P. Berrangé
2021-06-30 18:58 ` Wainer dos Santos Moschetta
2021-06-30 20:35 ` Daniel P. Berrangé
2021-07-05 10:35 ` Alex Bennée
2021-06-25 17:22 ` [PATCH 3/3] cirrus: delete FreeBSD and macOS jobs Daniel P. Berrangé
2021-06-28 7:29 ` Thomas Huth
2021-06-30 19:00 ` Wainer dos Santos Moschetta
2021-06-30 20:52 ` Willian Rampazzo
2021-06-28 7:34 ` [PATCH 0/3] ci: use cirrus-run to utilize Cirrus CI from GitLab CI Thomas Huth
2021-06-28 8:28 ` Daniel P. Berrangé
2021-07-05 10:32 ` 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=20210625172211.451010-2-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=emaste@freebsd.org \
--cc=f4bug@amsat.org \
--cc=luoyonggang@gmail.com \
--cc=lwhsu@freebsd.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
--cc=wainersm@redhat.com \
--cc=willianr@redhat.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).