blob: 486d6c07be3ba30e39850d75acb1b4ded2e1f346 [file] [log] [blame]
Patrick Williams58776372022-04-13 09:07:35 -05001From 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