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>
This commit is contained in:
Naveen Saini 2022-04-08 09:16:34 +08:00 committed by Khem Raj
parent d8187782ca
commit 8291505ccd
2 changed files with 62 additions and 1 deletions

View File

@ -0,0 +1,60 @@
From b06d16ec2d4aefc4cf1675e9dd6314956bc32d69 Mon Sep 17 00:00:00 2001
From: Naveen Saini <naveen.kumar.saini@intel.com>
Date: Thu, 7 Apr 2022 14:36:58 +0800
Subject: [PATCH] build: set HAVE_STATEMENT_EXPR var
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
Upstream-Status: Inappropriate
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
---
meson.build | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/meson.build b/meson.build
index 42e11aa..e8d218b 100644
--- a/meson.build
+++ b/meson.build
@@ -210,22 +210,8 @@ conf.set('ENABLE_DESTRUCTIVE', get_option('destructive').enabled())
conf.set('ENABLE_LOGGING', get_option('logging').enabled())
conf.set('ENABLE_DEBUG', get_option('dbg').enabled())
-typeof = cc.run('''
- int main() {
- struct {
- char a[16];
- } x;
- typeof(x) y;
-
- return sizeof(x) == sizeof(y);
- }
- '''
-)
-
-if typeof.compiled() and typeof.returncode() == 1
- conf.set('HAVE_TYPEOF', 1)
- conf.set('HAVE_STATEMENT_EXPR', 1)
-endif
+conf.set('HAVE_TYPEOF', 1)
+conf.set('HAVE_STATEMENT_EXPR', 1)
if target_machine.endian() == 'big'
conf.set('HAVE_BIG_ENDIAN', 1)
--
2.17.1

View File

@ -13,7 +13,8 @@ inherit meson pkgconfig bash-completion systemd
SRCREV = "dd58d43458943d20ff063850670bf54a5242c9c5"
SRC_URI = "git://github.com/pmem/ndctl.git;branch=main;protocol=https \
file://0001-util-Correct-path-to-iniparser.h.patch \
file://0001-meson-Use-pkg-config-to-detect-iniparser.patch"
file://0001-meson-Use-pkg-config-to-detect-iniparser.patch \
file://0001-build-set-HAVE_STATEMENT_EXPR-var.patch"
UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>v\d+(\.\d+)*)"