DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] event/dlb2: fix meson build
@ 2022-11-03 15:22 Ferruh Yigit
  2022-11-03 15:35 ` Thomas Monjalon
  0 siblings, 1 reply; 5+ messages in thread
From: Ferruh Yigit @ 2022-11-03 15:22 UTC (permalink / raw)
  To: Timothy McDaniel, Kent Wires
  Cc: dev, Thomas Monjalon, David Marchand, stable, Luca Boccassi

"meson setup" fails when '-Werror' compiler flag is enabled [1].
This is not a build error in the driver but a build error in meson
during "meson setup" stage.

This issue exists for a while but meson takes it as a warning and
ignores it unless '-Werror' compiler flag is provided.
Although it doesn't cause build error without '-Werror', relevant code
should be broken functionally, this patch fixes that too.

Build file using a variable to detect if macro defined, but that
variable is not set, looks like copy/paste error.
Replacing variable with hardcoded macro name.

[1]
Reproduced via `meson -Dc_args='-Werror' build`
in file 'build/meson-logs/meson-log.txt'

``
Running compile:
Working directory:  /tmp/tmpfrnw2x8z
Command line:  ccache cc /tmp/tmpfrnw2x8z/testfile.c -pipe -E -P
		-Werror -D_FILE_OFFSET_BITS=64 -P -O0 -march=native
Code:
        #ifndef dev/qat_crypto_pmd_gen4.c
        # define dev/qat_crypto_pmd_gen4.c
        #endif
        "MESON_GET_DEFINE_DELIMITER"
dev/qat_crypto_pmd_gen4.c
Compiler stdout:
         "MESON_GET_DEFINE_DELIMITER"
/qat_crypto_pmd_gen4.c/qat_crypto_pmd_gen4.c

Compiler stderr:
 /tmp/tmpfrnw2x8z/testfile.c:3:20:
    error: extra tokens at end of #ifndef directive [-Werror]
    3 |         #ifndef dev/qat_crypto_pmd_gen4.c
      |                    ^
/tmp/tmpfrnw2x8z/testfile.c:4:18:
    error: ISO C99 requires whitespace after the macro name [-Werror]
    4 |         # define dev/qat_crypto_pmd_gen4.c
      |                  ^~~
cc1: all warnings being treated as errors

drivers/event/dlb2/meson.build:41:10:
ERROR: Could not get define 'dev/qat_crypto_pmd_gen4.c'
``

Fixes: d0ce87e41cdc ("event/dlb2: support single 512B write of 4 QEs")
Cc: stable@dpdk.org

Reported-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 drivers/event/dlb2/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/event/dlb2/meson.build b/drivers/event/dlb2/meson.build
index 20ef159ab327..a2e60273c516 100644
--- a/drivers/event/dlb2/meson.build
+++ b/drivers/event/dlb2/meson.build
@@ -38,7 +38,7 @@ if binutils_ok
 
     # check if all required flags already enabled (variant a).
     dlb2_avx512_on = false
-    if cc.get_define(f, args: machine_args) == '__AVX512VL__'
+    if cc.get_define('__AVX512VL__', args: machine_args) != ''
         dlb2_avx512_on = true
     endif
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-11-07 14:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-03 15:22 [PATCH] event/dlb2: fix meson build Ferruh Yigit
2022-11-03 15:35 ` Thomas Monjalon
2022-11-03 16:22   ` Ferruh Yigit
2022-11-04 11:00     ` Jerin Jacob
2022-11-07 14:22       ` Jerin Jacob

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).