Patrick Williams | 5877637 | 2022-04-13 09:07:35 -0500 | [diff] [blame^] | 1 | From b06d16ec2d4aefc4cf1675e9dd6314956bc32d69 Mon Sep 17 00:00:00 2001 |
| 2 | From: Naveen Saini <naveen.kumar.saini@intel.com> |
| 3 | Date: Thu, 7 Apr 2022 14:36:58 +0800 |
| 4 | Subject: [PATCH] build: set HAVE_STATEMENT_EXPR var |
| 5 | |
| 6 | The v73 version tries to build and run a test program at compile |
| 7 | time to check whether compiler supports sizeof and expression statements |
| 8 | and sets HAVE_STATEMENT_EXPR accordingly. This requires EXEWRAPPER_ENABLED |
| 9 | in meson.bbclass to be True and qemu-usermode to be working. |
| 10 | |
| 11 | In cases when EXEWRAPPER_ENABLED is False, build fails with error: |
| 12 | |
| 13 | | ../git/meson.build:213:0: ERROR: Can not run test applications in |
| 14 | this cross environment. |
| 15 | |
| 16 | We don't really need to do this as these have been supported since gcc3 and can set the configs to 1. |
| 17 | |
| 18 | The autotools implementation also used to set it to 1 so this doesn't change anything: |
| 19 | |
| 20 | https://github.com/pmem/ndctl/blob/v72.1/configure.ac#L70 |
| 21 | |
| 22 | Upstream-Status: Inappropriate |
| 23 | |
| 24 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> |
| 25 | --- |
| 26 | meson.build | 18 ++---------------- |
| 27 | 1 file changed, 2 insertions(+), 16 deletions(-) |
| 28 | |
| 29 | diff --git a/meson.build b/meson.build |
| 30 | index 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 | -- |
| 59 | 2.17.1 |
| 60 | |