summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNaveen Saini <naveen.kumar.saini@intel.com>2022-04-08 09:16:34 +0800
committerKhem Raj <raj.khem@gmail.com>2022-04-10 10:05:35 -0700
commit8291505ccdca91ddbb616e930e7584f18c34ad87 (patch)
tree6e06b9f3de04a318fc9d1dfe33f1f335b9702ea6
parentd8187782ca6a5c13bffbbf7ecdaa102715ee1576 (diff)
downloadmeta-openembedded-8291505ccdca91ddbb616e930e7584f18c34ad87.tar.gz
ndctl: fix build failure with EXEWRAPPER_ENABLED False
The v73 version tries to build and run a test program at compile time to check whether compiler supports sizeof and expression statements and sets HAVE_STATEMENT_EXPR accordingly. This requires EXEWRAPPER_ENABLED in meson.bbclass to be True and qemu-usermode to be working. In cases when EXEWRAPPER_ENABLED is False, build fails with error: | ../git/meson.build:213:0: ERROR: Can not run test applications in this cross environment. We don't really need to do this as these have been supported since gcc3 and can set the configs to 1. The autotools implementation also used to set it to 1 so this doesn't change anything: https://github.com/pmem/ndctl/blob/v72.1/configure.ac#L70 Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-core/ndctl/ndctl/0001-build-set-HAVE_STATEMENT_EXPR-var.patch60
-rw-r--r--meta-oe/recipes-core/ndctl/ndctl_v73.bb3
2 files changed, 62 insertions, 1 deletions
diff --git a/meta-oe/recipes-core/ndctl/ndctl/0001-build-set-HAVE_STATEMENT_EXPR-var.patch b/meta-oe/recipes-core/ndctl/ndctl/0001-build-set-HAVE_STATEMENT_EXPR-var.patch
new file mode 100644
index 000000000..486d6c07b
--- /dev/null
+++ b/meta-oe/recipes-core/ndctl/ndctl/0001-build-set-HAVE_STATEMENT_EXPR-var.patch
@@ -0,0 +1,60 @@
1From b06d16ec2d4aefc4cf1675e9dd6314956bc32d69 Mon Sep 17 00:00:00 2001
2From: Naveen Saini <naveen.kumar.saini@intel.com>
3Date: Thu, 7 Apr 2022 14:36:58 +0800
4Subject: [PATCH] build: set HAVE_STATEMENT_EXPR var
5
6The v73 version tries to build and run a test program at compile
7time to check whether compiler supports sizeof and expression statements
8and sets HAVE_STATEMENT_EXPR accordingly. This requires EXEWRAPPER_ENABLED
9in meson.bbclass to be True and qemu-usermode to be working.
10
11In cases when EXEWRAPPER_ENABLED is False, build fails with error:
12
13| ../git/meson.build:213:0: ERROR: Can not run test applications in
14this cross environment.
15
16We don't really need to do this as these have been supported since gcc3 and can set the configs to 1.
17
18The autotools implementation also used to set it to 1 so this doesn't change anything:
19
20https://github.com/pmem/ndctl/blob/v72.1/configure.ac#L70
21
22Upstream-Status: Inappropriate
23
24Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
25---
26 meson.build | 18 ++----------------
27 1 file changed, 2 insertions(+), 16 deletions(-)
28
29diff --git a/meson.build b/meson.build
30index 42e11aa..e8d218b 100644
31--- a/meson.build
32+++ b/meson.build
33@@ -210,22 +210,8 @@ conf.set('ENABLE_DESTRUCTIVE', get_option('destructive').enabled())
34 conf.set('ENABLE_LOGGING', get_option('logging').enabled())
35 conf.set('ENABLE_DEBUG', get_option('dbg').enabled())
36
37-typeof = cc.run('''
38- int main() {
39- struct {
40- char a[16];
41- } x;
42- typeof(x) y;
43-
44- return sizeof(x) == sizeof(y);
45- }
46- '''
47-)
48-
49-if typeof.compiled() and typeof.returncode() == 1
50- conf.set('HAVE_TYPEOF', 1)
51- conf.set('HAVE_STATEMENT_EXPR', 1)
52-endif
53+conf.set('HAVE_TYPEOF', 1)
54+conf.set('HAVE_STATEMENT_EXPR', 1)
55
56 if target_machine.endian() == 'big'
57 conf.set('HAVE_BIG_ENDIAN', 1)
58--
592.17.1
60
diff --git a/meta-oe/recipes-core/ndctl/ndctl_v73.bb b/meta-oe/recipes-core/ndctl/ndctl_v73.bb
index c88d39297..da649d578 100644
--- a/meta-oe/recipes-core/ndctl/ndctl_v73.bb
+++ b/meta-oe/recipes-core/ndctl/ndctl_v73.bb
@@ -13,7 +13,8 @@ inherit meson pkgconfig bash-completion systemd
13SRCREV = "dd58d43458943d20ff063850670bf54a5242c9c5" 13SRCREV = "dd58d43458943d20ff063850670bf54a5242c9c5"
14SRC_URI = "git://github.com/pmem/ndctl.git;branch=main;protocol=https \ 14SRC_URI = "git://github.com/pmem/ndctl.git;branch=main;protocol=https \
15 file://0001-util-Correct-path-to-iniparser.h.patch \ 15 file://0001-util-Correct-path-to-iniparser.h.patch \
16 file://0001-meson-Use-pkg-config-to-detect-iniparser.patch" 16 file://0001-meson-Use-pkg-config-to-detect-iniparser.patch \
17 file://0001-build-set-HAVE_STATEMENT_EXPR-var.patch"
17 18
18UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>v\d+(\.\d+)*)" 19UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>v\d+(\.\d+)*)"
19 20