[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 06/40] build: validate that system capstone works before using
From: |
Alex Bennée |
Subject: |
[PATCH v3 06/40] build: validate that system capstone works before using it |
Date: |
Fri, 9 Jul 2021 15:29:31 +0100 |
From: Daniel P. Berrangé <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>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Message-Id: <20210625172211.451010-2-berrange@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
v3
- fix double it.
---
meson.build | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/meson.build b/meson.build
index 7e12de01be..ff7a9f8b4f 100644
--- a/meson.build
+++ b/meson.build
@@ -1641,6 +1641,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 does not appear to work')
+ endif
+ endif
+
if capstone.found()
capstone_opt = 'system'
elif have_internal
--
2.20.1
- [PATCH for 6.1 v3 00/40] testing and plugins pre-PR, Alex Bennée, 2021/07/09
- [PATCH v3 01/40] Jobs based on custom runners: documentation and configuration placeholder, Alex Bennée, 2021/07/09
- [PATCH v3 02/40] Jobs based on custom runners: build environment docs and playbook, Alex Bennée, 2021/07/09
- [PATCH v3 04/40] Jobs based on custom runners: add job definitions for QEMU's machines, Alex Bennée, 2021/07/09
- [PATCH v3 03/40] Jobs based on custom runners: docs and gitlab-runner setup playbook, Alex Bennée, 2021/07/09
- [PATCH v3 05/40] tests/tcg: also disable the signals test for plugins, Alex Bennée, 2021/07/09
- [PATCH v3 06/40] build: validate that system capstone works before using it,
Alex Bennée <=
- [PATCH v3 10/40] tests/docker: don't use BUILDKIT in GitLab either, Alex Bennée, 2021/07/09
- [PATCH v3 07/40] gitlab: support for FreeBSD 12, 13 and macOS 11 via cirrus-run, Alex Bennée, 2021/07/09
- [PATCH v3 09/40] hw/usb/ccid: remove references to NSS, Alex Bennée, 2021/07/09
- [PATCH v3 08/40] cirrus: delete FreeBSD and macOS jobs, Alex Bennée, 2021/07/09
- [PATCH v3 16/40] tests/docker: fix mistakes in fedora package list, Alex Bennée, 2021/07/09
- [PATCH v3 21/40] tests/docker: expand ubuntu1804 package list, Alex Bennée, 2021/07/09
- [PATCH v3 17/40] tests/docker: fix mistakes in ubuntu package lists, Alex Bennée, 2021/07/09
- [PATCH v3 15/40] tests/docker: fix mistakes in centos package lists, Alex Bennée, 2021/07/09
- [PATCH v3 12/40] tests/docker: use explicit docker.io registry, Alex Bennée, 2021/07/09
- [PATCH v3 19/40] tests/docker: expand centos8 package list, Alex Bennée, 2021/07/09