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

* Re: [PATCH] event/dlb2: fix meson build
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Monjalon @ 2022-11-03 15:35 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Timothy McDaniel, Kent Wires, dev, David Marchand, stable, Luca Boccassi

03/11/2022 16:22, Ferruh Yigit:
> "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.
[...]
> Reproduced via `meson -Dc_args='-Werror' build`

Is it different of 'meson --werror" as in devtools/test-meson-builds.sh
or 'meson -Dwerror=true' as in .ci/linux-build.sh?




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

* Re: [PATCH] event/dlb2: fix meson build
  2022-11-03 15:35 ` Thomas Monjalon
@ 2022-11-03 16:22   ` Ferruh Yigit
  2022-11-04 11:00     ` Jerin Jacob
  0 siblings, 1 reply; 5+ messages in thread
From: Ferruh Yigit @ 2022-11-03 16:22 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Timothy McDaniel, Kent Wires, dev, David Marchand, stable,
	Luca Boccassi, Bruce Richardson, Mcnamara, John

On 11/3/2022 3:35 PM, Thomas Monjalon wrote:
> 03/11/2022 16:22, Ferruh Yigit:
>> "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.
> [...]
>> Reproduced via `meson -Dc_args='-Werror' build`
> 
> Is it different of 'meson --werror" as in devtools/test-meson-builds.sh
> or 'meson -Dwerror=true' as in .ci/linux-build.sh?
> 

As I checked now, it seems there is a difference.

Via "meson --werror" & "meson -Dwerror=true",
'-Werror' flag is used to compile dpdk source code, but meson doesn't 
use the flag for its internal logic, so this seems more proper usage.

Via "meson -Dc_args='-Werror'" & "CFLAGS='-Werror' meson" usage,
'-Werror' flag is used both to compile dpdk code and meson internal 
logic, so that is why this usage cause build error.


And independent from the above usage difference, event/dlb2 meson file 
is wrong and this fix is required.
I assume 'dlb2_avx512.c' compiled because of the '-mavx512vl' fallback 
and that is why mentioned error is not detected.

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

* Re: [PATCH] event/dlb2: fix meson build
  2022-11-03 16:22   ` Ferruh Yigit
@ 2022-11-04 11:00     ` Jerin Jacob
  2022-11-07 14:22       ` Jerin Jacob
  0 siblings, 1 reply; 5+ messages in thread
From: Jerin Jacob @ 2022-11-04 11:00 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Thomas Monjalon, Timothy McDaniel, Kent Wires, dev,
	David Marchand, stable, Luca Boccassi, Bruce Richardson,
	Mcnamara, John, Abdullah Sevincer

On Thu, Nov 3, 2022 at 9:52 PM Ferruh Yigit <ferruh.yigit@amd.com> wrote:
>
> On 11/3/2022 3:35 PM, Thomas Monjalon wrote:
> > 03/11/2022 16:22, Ferruh Yigit:
> >> "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.
> > [...]
> >> Reproduced via `meson -Dc_args='-Werror' build`
> >
> > Is it different of 'meson --werror" as in devtools/test-meson-builds.sh
> > or 'meson -Dwerror=true' as in .ci/linux-build.sh?
> >
>
> As I checked now, it seems there is a difference.
>
> Via "meson --werror" & "meson -Dwerror=true",
> '-Werror' flag is used to compile dpdk source code, but meson doesn't
> use the flag for its internal logic, so this seems more proper usage.
>
> Via "meson -Dc_args='-Werror'" & "CFLAGS='-Werror' meson" usage,
> '-Werror' flag is used both to compile dpdk code and meson internal
> logic, so that is why this usage cause build error.
>
>
> And independent from the above usage difference, event/dlb2 meson file
> is wrong and this fix is required.
> I assume 'dlb2_avx512.c' compiled because of the '-mavx512vl' fallback
> and that is why mentioned error is not detected.

+ @abdullah.sevincer@intel.com

Waiting from Ack from Abdullah to merge

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

* Re: [PATCH] event/dlb2: fix meson build
  2022-11-04 11:00     ` Jerin Jacob
@ 2022-11-07 14:22       ` Jerin Jacob
  0 siblings, 0 replies; 5+ messages in thread
From: Jerin Jacob @ 2022-11-07 14:22 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Thomas Monjalon, Timothy McDaniel, Kent Wires, dev,
	David Marchand, stable, Luca Boccassi, Bruce Richardson,
	Mcnamara, John, Abdullah Sevincer

On Fri, Nov 4, 2022 at 4:30 PM Jerin Jacob <jerinjacobk@gmail.com> wrote:
>
> On Thu, Nov 3, 2022 at 9:52 PM Ferruh Yigit <ferruh.yigit@amd.com> wrote:
> >
> > On 11/3/2022 3:35 PM, Thomas Monjalon wrote:
> > > 03/11/2022 16:22, Ferruh Yigit:
> > >> "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.
> > > [...]
> > >> Reproduced via `meson -Dc_args='-Werror' build`
> > >
> > > Is it different of 'meson --werror" as in devtools/test-meson-builds.sh
> > > or 'meson -Dwerror=true' as in .ci/linux-build.sh?
> > >
> >
> > As I checked now, it seems there is a difference.
> >
> > Via "meson --werror" & "meson -Dwerror=true",
> > '-Werror' flag is used to compile dpdk source code, but meson doesn't
> > use the flag for its internal logic, so this seems more proper usage.
> >
> > Via "meson -Dc_args='-Werror'" & "CFLAGS='-Werror' meson" usage,
> > '-Werror' flag is used both to compile dpdk code and meson internal
> > logic, so that is why this usage cause build error.
> >
> >
> > And independent from the above usage difference, event/dlb2 meson file
> > is wrong and this fix is required.
> > I assume 'dlb2_avx512.c' compiled because of the '-mavx512vl' fallback
> > and that is why mentioned error is not detected.
>
> + @abdullah.sevincer@intel.com
>
> Waiting from Ack from Abdullah to merge

No reply. Patch looks reasonable to me.

Applied to dpdk-next-net-eventdev/for-main. Thanks

^ 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).