DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] meson: fix compilation with binutils version 2.30
@ 2019-01-17 17:17 Harry van Haaren
  2019-01-17 17:23 ` Ferruh Yigit
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Harry van Haaren @ 2019-01-17 17:17 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, bruce.richardson, thomas, Harry van Haaren

This commit reworks the checks for binutils 2.30 and how
the flags to disable AVX512F are passed to the compiler.

Previously the #define for including AVX512 code was set,
while the -mno-avx512f argument was given to the compiler.
This would cause gcc to correctly refuse to emit AVX512
instructions, but the rte_memcpy code that includes AVX512
optimizations was being added to the build.

The check for binutils check is now moved to x86 as it is
irrelevant for other architectures, and the -mno-avx512f
flag is passed to a march_opts array in meson. As the
-mno-avx512 flag is added earlier in the build, the code
in rte_memcpy is no longer attempted to be compiled.

This commit also adds a message print in the meson configure
stage to alert the user of the workaround being employed.

Fixes: a32ca9a4ebc1 ("mk: fix scope of disabling AVX512F support")

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>

---
 config/meson.build     |  8 --------
 config/x86/meson.build | 11 ++++++++++-
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index 40802fc88..db32499b3 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -43,14 +43,6 @@ toolchain = cc.get_id()
 dpdk_conf.set_quoted('RTE_TOOLCHAIN', toolchain)
 dpdk_conf.set('RTE_TOOLCHAIN_' + toolchain.to_upper(), 1)
 
-# get binutils version for the workaround of Bug 97
-ldver = run_command('ld', '-v').stdout().strip()
-if ldver.contains('2.30')
-	if cc.has_argument('-mno-avx512f')
-		machine_args += '-mno-avx512f'
-	endif
-endif
-
 add_project_link_arguments('-Wl,--no-as-needed', language: 'c')
 dpdk_extra_ldflags += '-Wl,--no-as-needed'
 
diff --git a/config/x86/meson.build b/config/x86/meson.build
index 33efb5e54..935ce22eb 100644
--- a/config/x86/meson.build
+++ b/config/x86/meson.build
@@ -2,7 +2,16 @@
 # Copyright(c) 2017 Intel Corporation
 
 # for checking defines we need to use the correct compiler flags
-march_opt = '-march=@0@'.format(machine)
+march_opt = ['-march=@0@'.format(machine)]
+
+# get binutils version for the workaround of Bug 97
+ldver = run_command('ld', '-v').stdout().strip()
+if ldver.contains('2.30')
+	if cc.has_argument('-mno-avx512f')
+		march_opt += '-mno-avx512f'
+		message('Binutils 2.30 detected, disabling AVX512 support due to workaround for DPDK bugzilla bug #97')
+	endif
+endif
 
 # we require SSE4.2 for DPDK
 sse_errormsg = '''SSE4.2 instruction set is required for DPDK.
-- 
2.17.1

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

* Re: [dpdk-dev] [PATCH] meson: fix compilation with binutils version 2.30
  2019-01-17 17:17 [dpdk-dev] [PATCH] meson: fix compilation with binutils version 2.30 Harry van Haaren
@ 2019-01-17 17:23 ` Ferruh Yigit
  2019-01-17 18:23   ` Thomas Monjalon
  2019-01-17 17:56 ` Thomas Monjalon
  2019-02-06 16:16 ` Kevin Traynor
  2 siblings, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2019-01-17 17:23 UTC (permalink / raw)
  To: Harry van Haaren, dev; +Cc: bruce.richardson, thomas

On 1/17/2019 5:17 PM, Harry van Haaren wrote:
> This commit reworks the checks for binutils 2.30 and how
> the flags to disable AVX512F are passed to the compiler.
> 
> Previously the #define for including AVX512 code was set,
> while the -mno-avx512f argument was given to the compiler.
> This would cause gcc to correctly refuse to emit AVX512
> instructions, but the rte_memcpy code that includes AVX512
> optimizations was being added to the build.
> 
> The check for binutils check is now moved to x86 as it is
> irrelevant for other architectures, and the -mno-avx512f
> flag is passed to a march_opts array in meson. As the
> -mno-avx512 flag is added earlier in the build, the code
> in rte_memcpy is no longer attempted to be compiled.
> 
> This commit also adds a message print in the meson configure
> stage to alert the user of the workaround being employed.
> 
> Fixes: a32ca9a4ebc1 ("mk: fix scope of disabling AVX512F support")
> 
> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>

Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>

Thanks for the fix Harry.

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

* Re: [dpdk-dev] [PATCH] meson: fix compilation with binutils version 2.30
  2019-01-17 17:17 [dpdk-dev] [PATCH] meson: fix compilation with binutils version 2.30 Harry van Haaren
  2019-01-17 17:23 ` Ferruh Yigit
@ 2019-01-17 17:56 ` Thomas Monjalon
  2019-01-17 18:19   ` Van Haaren, Harry
  2019-02-06 16:16 ` Kevin Traynor
  2 siblings, 1 reply; 6+ messages in thread
From: Thomas Monjalon @ 2019-01-17 17:56 UTC (permalink / raw)
  To: Harry van Haaren; +Cc: dev, ferruh.yigit, bruce.richardson

17/01/2019 18:17, Harry van Haaren:
> +# get binutils version for the workaround of Bug 97
> +ldver = run_command('ld', '-v').stdout().strip()
> +if ldver.contains('2.30')
> +	if cc.has_argument('-mno-avx512f')
> +		march_opt += '-mno-avx512f'
> +		message('Binutils 2.30 detected, disabling AVX512 support due to workaround for DPDK bugzilla bug #97')

May I reword?
	Binutils 2.30 detected, disabling AVX512 support as workaround for bug #97

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

* Re: [dpdk-dev] [PATCH] meson: fix compilation with binutils version 2.30
  2019-01-17 17:56 ` Thomas Monjalon
@ 2019-01-17 18:19   ` Van Haaren, Harry
  0 siblings, 0 replies; 6+ messages in thread
From: Van Haaren, Harry @ 2019-01-17 18:19 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Yigit, Ferruh, Richardson, Bruce

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Thursday, January 17, 2019 5:56 PM
> To: Van Haaren, Harry <harry.van.haaren@intel.com>
> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>
> Subject: Re: [dpdk-dev] [PATCH] meson: fix compilation with binutils version
> 2.30
> 
> 17/01/2019 18:17, Harry van Haaren:
> > +# get binutils version for the workaround of Bug 97
> > +ldver = run_command('ld', '-v').stdout().strip()
> > +if ldver.contains('2.30')
> > +	if cc.has_argument('-mno-avx512f')
> > +		march_opt += '-mno-avx512f'
> > +		message('Binutils 2.30 detected, disabling AVX512 support due to
> workaround for DPDK bugzilla bug #97')
> 
> May I reword?
> 	Binutils 2.30 detected, disabling AVX512 support as workaround for bug
> #97

Yep sure, thanks!

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

* Re: [dpdk-dev] [PATCH] meson: fix compilation with binutils version 2.30
  2019-01-17 17:23 ` Ferruh Yigit
@ 2019-01-17 18:23   ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2019-01-17 18:23 UTC (permalink / raw)
  To: Harry van Haaren; +Cc: dev, Ferruh Yigit, bruce.richardson

17/01/2019 18:23, Ferruh Yigit:
> On 1/17/2019 5:17 PM, Harry van Haaren wrote:
> > This commit reworks the checks for binutils 2.30 and how
> > the flags to disable AVX512F are passed to the compiler.
> > 
> > Previously the #define for including AVX512 code was set,
> > while the -mno-avx512f argument was given to the compiler.
> > This would cause gcc to correctly refuse to emit AVX512
> > instructions, but the rte_memcpy code that includes AVX512
> > optimizations was being added to the build.
> > 
> > The check for binutils check is now moved to x86 as it is
> > irrelevant for other architectures, and the -mno-avx512f
> > flag is passed to a march_opts array in meson. As the
> > -mno-avx512 flag is added earlier in the build, the code
> > in rte_memcpy is no longer attempted to be compiled.
> > 
> > This commit also adds a message print in the meson configure
> > stage to alert the user of the workaround being employed.
> > 
> > Fixes: a32ca9a4ebc1 ("mk: fix scope of disabling AVX512F support")
> > 
> > Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
> 
> Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 
> Thanks for the fix Harry.

Applied (with message reworded as suggested), thanks

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

* Re: [dpdk-dev] [PATCH] meson: fix compilation with binutils version 2.30
  2019-01-17 17:17 [dpdk-dev] [PATCH] meson: fix compilation with binutils version 2.30 Harry van Haaren
  2019-01-17 17:23 ` Ferruh Yigit
  2019-01-17 17:56 ` Thomas Monjalon
@ 2019-02-06 16:16 ` Kevin Traynor
  2 siblings, 0 replies; 6+ messages in thread
From: Kevin Traynor @ 2019-02-06 16:16 UTC (permalink / raw)
  To: Harry van Haaren, dev; +Cc: ferruh.yigit, bruce.richardson, thomas

On 01/17/2019 05:17 PM, Harry van Haaren wrote:
> This commit reworks the checks for binutils 2.30 and how
> the flags to disable AVX512F are passed to the compiler.
> 
> Previously the #define for including AVX512 code was set,
> while the -mno-avx512f argument was given to the compiler.
> This would cause gcc to correctly refuse to emit AVX512
> instructions, but the rte_memcpy code that includes AVX512
> optimizations was being added to the build.
> 
> The check for binutils check is now moved to x86 as it is
> irrelevant for other architectures, and the -mno-avx512f
> flag is passed to a march_opts array in meson. As the
> -mno-avx512 flag is added earlier in the build, the code
> in rte_memcpy is no longer attempted to be compiled.
> 
> This commit also adds a message print in the meson configure
> stage to alert the user of the workaround being employed.
> 
> Fixes: a32ca9a4ebc1 ("mk: fix scope of disabling AVX512F support")
> 

The patch this fixes is queued for 18.11 stable, so I presume this
should go there as well. I will send it as part of the normal queued
email anyway, so please let me know if there's a reason not to backport.

> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
> 
> ---

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

end of thread, other threads:[~2019-02-06 16:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-17 17:17 [dpdk-dev] [PATCH] meson: fix compilation with binutils version 2.30 Harry van Haaren
2019-01-17 17:23 ` Ferruh Yigit
2019-01-17 18:23   ` Thomas Monjalon
2019-01-17 17:56 ` Thomas Monjalon
2019-01-17 18:19   ` Van Haaren, Harry
2019-02-06 16:16 ` Kevin Traynor

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