DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] buildtools: allow pedantic empty pmdinfo
@ 2020-02-05 17:07 Thomas Monjalon
  2020-02-05 17:14 ` Bruce Richardson
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Monjalon @ 2020-02-05 17:07 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson

If a driver has no info generated by pmdinfogen,
and if this driver is compiled as pedantic,
then an failure would occur:
	drivers/rte_common_mlx5.pmd.c:1: error:
	ISO C forbids an empty translation unit [-Werror=pedantic]
Such error is triggered with the new mlx5 common directory.

In order to allow an "empty driver info" compiled in pedantic mode,
the script generating .pmd.c file is modified to add a static string
unconditionnaly.
The minimal generated code is:
	static __attribute__((unused)) const char *generator =
		"/path/to/dpdk/buildtools/gen-pmdinfo-cfile.sh";

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 buildtools/gen-pmdinfo-cfile.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/buildtools/gen-pmdinfo-cfile.sh b/buildtools/gen-pmdinfo-cfile.sh
index 0b6dc2ce4f..43059cf364 100755
--- a/buildtools/gen-pmdinfo-cfile.sh
+++ b/buildtools/gen-pmdinfo-cfile.sh
@@ -6,7 +6,8 @@ arfile=$1
 output=$2
 pmdinfogen=$3
 
-echo > $output
+# The generated file must not be empty if compiled in pedantic mode
+echo 'static __attribute__((unused)) const char *generator = "'$0'";' > $output
 for ofile in `ar t $arfile` ; do
 	ar p $arfile $ofile | $pmdinfogen - - >> $output 2> /dev/null
 done
-- 
2.25.0


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

* Re: [dpdk-dev] [PATCH] buildtools: allow pedantic empty pmdinfo
  2020-02-05 17:07 [dpdk-dev] [PATCH] buildtools: allow pedantic empty pmdinfo Thomas Monjalon
@ 2020-02-05 17:14 ` Bruce Richardson
  2020-02-05 17:29   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Bruce Richardson @ 2020-02-05 17:14 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On Wed, Feb 05, 2020 at 06:07:23PM +0100, Thomas Monjalon wrote:
> If a driver has no info generated by pmdinfogen,
> and if this driver is compiled as pedantic,
> then an failure would occur:
> 	drivers/rte_common_mlx5.pmd.c:1: error:
> 	ISO C forbids an empty translation unit [-Werror=pedantic]
> Such error is triggered with the new mlx5 common directory.
> 
> In order to allow an "empty driver info" compiled in pedantic mode,
> the script generating .pmd.c file is modified to add a static string
> unconditionnaly.
> The minimal generated code is:
> 	static __attribute__((unused)) const char *generator =
> 		"/path/to/dpdk/buildtools/gen-pmdinfo-cfile.sh";
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

LGTM

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

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

* Re: [dpdk-dev] [PATCH] buildtools: allow pedantic empty pmdinfo
  2020-02-05 17:14 ` Bruce Richardson
@ 2020-02-05 17:29   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2020-02-05 17:29 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: dev, ferruh.yigit, matan, maxime.coquelin, david.marchand

05/02/2020 18:14, Bruce Richardson:
> On Wed, Feb 05, 2020 at 06:07:23PM +0100, Thomas Monjalon wrote:
> > If a driver has no info generated by pmdinfogen,
> > and if this driver is compiled as pedantic,
> > then an failure would occur:
> > 	drivers/rte_common_mlx5.pmd.c:1: error:
> > 	ISO C forbids an empty translation unit [-Werror=pedantic]
> > Such error is triggered with the new mlx5 common directory.
> > 
> > In order to allow an "empty driver info" compiled in pedantic mode,
> > the script generating .pmd.c file is modified to add a static string
> > unconditionnaly.
> > The minimal generated code is:
> > 	static __attribute__((unused)) const char *generator =
> > 		"/path/to/dpdk/buildtools/gen-pmdinfo-cfile.sh";
> > 
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> 
> LGTM
> 
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks, it will allow pulling next-net
without breaking debug compilation for the new ABI tooling.



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

end of thread, other threads:[~2020-02-05 17:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05 17:07 [dpdk-dev] [PATCH] buildtools: allow pedantic empty pmdinfo Thomas Monjalon
2020-02-05 17:14 ` Bruce Richardson
2020-02-05 17:29   ` Thomas Monjalon

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