build/pkg-config: remove machine arch flag
RFC PATCH 1/1 build/pkg-config: remove machine arch flag
Traditionally any apps built using DPDK had to support the same instruction sets as supported when the DPDK SDK itself was built, since that was "leaked" through to the end-app and DPDK headers via RTE_MACHINE_CPUFLAG_* values. Therefore, when converting over to meson for app build correctness the "-march=" flag was included in the pkg-config cflags output.
However, since the DPDK-specific CPU flags are now obsolete, and we instead check directly for compiler-defined flags, we should no longer need to force the exact same architecture match in all cases. To faciliate such flexibility, a new pkg_config_machine_args array - which defaults to the existing machine_args array has been defined. The individual architectures - x86, arm and ppc - can choose if and how to override this value themselves.
For x86, since SSE4.2 is the minimum instruction-set level needed to run DPDK, and since some header files assume that minimum level of instruction set support, we override the "-march=" value with "-msse4" for the pkg-config file. This allows end applications to set their own "march" value while still ensuring valid DPDK compilation.
---
CC: Jerin Jacob <[email protected]>
CC: Ruifeng Wang <[email protected]>
CC: Honnappa Nagarahalli <[email protected]>
CC: David Christensen <[email protected]>
Feedback requested from ARM and PPC maintainers as to this change and what flags, if any, need to be in the .pc file for DPDK on such platforms. For example - is setting 'pkg_config_machine_args' to 'machine_args' by default necessary behaviour?
--- buildtools/pkg-config/meson.build | 2 +- config/meson.build | 1 + config/x86/meson.build | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-)
buildtools/pkg-config/meson.build +1 -1
@@ -2,7 +2,7 @@ # Copyright(c) 2020 Intel Corporation pkg = import('pkgconfig') -pkg_extra_cflags = ['-include', 'rte_config.h'] + machine_args +pkg_extra_cflags = ['-include', 'rte_config.h'] + pkg_config_machine_args if is_freebsd pkg_extra_cflags += ['-D__BSD_VISIBLE'] endif
config/meson.build +1 -0
@@ -100,6 +100,7 @@ if host_machine.cpu_family().startswith('ppc') else machine_args += '-march=' + machine endif +pkg_config_machine_args = machine_args # may be overriden late per arch toolchain = cc.get_id() dpdk_conf.set_quoted('RTE_TOOLCHAIN', toolchain)
config/x86/meson.build +3 -0
@@ -16,6 +16,9 @@ if cc.get_define('__SSE4_2__', args: machine_args) == '' machine_args += '-msse4' endif +# require SSE4.2 in pkg-config file - don't use -march +pkg_config_machine_args = ['-msse4'] + base_flags = ['SSE', 'SSE2', 'SSE3','SSSE3', 'SSE4_1', 'SSE4_2'] foreach f:base_flags compile_time_cpuflags += ['RTE_CPUFLAG_' + f]
--
2.27.0
Quoted 24 lines · Bruce Richardson
Traditionally any apps built using DPDK had to support the same instruction sets as supported when the DPDK SDK itself was built, since that was "leaked" through to the end-app and DPDK headers via RTE_MACHINE_CPUFLAG_* values. Therefore, when converting over to meson for app build correctness the "-march=" flag was included in the pkg-config cflags output.
However, since the DPDK-specific CPU flags are now obsolete, and we instead check directly for compiler-defined flags, we should no longer need to force the exact same architecture match in all cases. To faciliate such flexibility, a new
pkg_config_machine_argsarray - which defaults to the existingmachine_argsarray has been defined. The individual architectures - x86, arm and ppc - can choose if and how to override this value themselves.For x86, since SSE4.2 is the minimum instruction-set level needed to run DPDK, and since some header files assume that minimum level of instruction set support, we override the "-march=" value with "-msse4" for the pkg-config file. This allows end applications to set their own "march" value while still ensuring valid DPDK compilation.
Signed-off-by Bruce Richardson <[email protected]>---
Quoted 8 lines
CC: Jerin Jacob <[email protected]>
CC: Ruifeng Wang <[email protected]>
CC: Honnappa Nagarahalli <[email protected]>
CC: David Christensen <[email protected]>
Feedback requested from ARM and PPC maintainers as to this change and what flags, if any, need to be in the .pc file for DPDK on such platforms. For example - is setting 'pkg_config_machine_args' to 'machine_args' by default necessary behaviour?
Support for Altivec would be the equivalent here for PPC and I'm not aware of any additional flags required for supported POWER CPUs on DPDK.
I can't speak to P10 requirements yet but the proposed change is a
don't care for me.
Dave
Quoted 24 lines · Bruce Richardson
Traditionally any apps built using DPDK had to support the same instruction sets as supported when the DPDK SDK itself was built, since that was "leaked" through to the end-app and DPDK headers via RTE_MACHINE_CPUFLAG_* values. Therefore, when converting over to meson for app build correctness the "-march=" flag was included in the pkg-config cflags output.
However, since the DPDK-specific CPU flags are now obsolete, and we instead check directly for compiler-defined flags, we should no longer need to force the exact same architecture match in all cases. To faciliate such flexibility, a new
pkg_config_machine_argsarray - which defaults to the existingmachine_argsarray has been defined. The individual architectures - x86, arm and ppc - can choose if and how to override this value themselves.For x86, since SSE4.2 is the minimum instruction-set level needed to run DPDK, and since some header files assume that minimum level of instruction set support, we override the "-march=" value with "-msse4" for the pkg-config file. This allows end applications to set their own "march" value while still ensuring valid DPDK compilation.
Signed-off-by Bruce Richardson <[email protected]>---
Quoted 9 lines
CC: Jerin Jacob <[email protected]>
CC: Ruifeng Wang <[email protected]>
CC: Honnappa Nagarahalli <[email protected]>
CC: David Christensen <[email protected]>
Feedback requested from ARM and PPC maintainers as to this change and what flags, if any, need to be in the .pc file for DPDK on such platforms. For example - is setting 'pkg_config_machine_args' to 'machine_args' by default necessary behaviour?
Ping for further thoughts or input on this patch.
/Bruce
Quoted 48 lines
--- buildtools/pkg-config/meson.build | 2 +- config/meson.build | 1 + config/x86/meson.build | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-)buildtools/pkg-config/meson.build +1
-1@@ -2,7 +2,7 @@ # Copyright(c) 2020 Intel Corporation pkg = import('pkgconfig') -pkg_extra_cflags = ['-include', 'rte_config.h'] + machine_args +pkg_extra_cflags = ['-include', 'rte_config.h'] + pkg_config_machine_args if is_freebsd pkg_extra_cflags += ['-D__BSD_VISIBLE'] endifconfig/meson.build +1
-0@@ -100,6 +100,7 @@ if host_machine.cpu_family().startswith('ppc') else machine_args += '-march=' + machine endif +pkg_config_machine_args = machine_args # may be overriden late per arch toolchain = cc.get_id() dpdk_conf.set_quoted('RTE_TOOLCHAIN', toolchain)config/x86/meson.build +3
-1@@ -16,6 +16,9 @@ if cc.get_define('__SSE4_2__', args: machine_args) == '' machine_args += '-msse4' endif +# require SSE4.2 in pkg-config file - don't use -march +pkg_config_machine_args = ['-msse4'] + base_flags = ['SSE', 'SSE2', 'SSE3','SSSE3', 'SSE4_1', 'SSE4_2'] foreach f:base_flags compile_time_cpuflags += ['RTE_CPUFLAG_' + f] --2.27.0
Quoted 34 lines · Bruce Richardson
Quoted 24 lines · Bruce Richardson
Traditionally any apps built using DPDK had to support the same instruction sets as supported when the DPDK SDK itself was built, since that was "leaked" through to the end-app and DPDK headers via RTE_MACHINE_CPUFLAG_* values. Therefore, when converting over to meson for app build correctness the "-march=" flag was included in the pkg-config cflags output.
However, since the DPDK-specific CPU flags are now obsolete, and we instead check directly for compiler-defined flags, we should no longer need to force the exact same architecture match in all cases. To faciliate such flexibility, a new
pkg_config_machine_argsarray - which defaults to the existingmachine_argsarray has been defined. The individual architectures - x86, arm and ppc - can choose if and how to override this value themselves.For x86, since SSE4.2 is the minimum instruction-set level needed to run DPDK, and since some header files assume that minimum level of instruction set support, we override the "-march=" value with "-msse4" for the pkg-config file. This allows end applications to set their own "march" value while still ensuring valid DPDK compilation.
Signed-off-by Bruce Richardson <[email protected]>---
Quoted 8 lines
CC: Jerin Jacob <[email protected]>
CC: Ruifeng Wang <[email protected]>
CC: Honnappa Nagarahalli <[email protected]>
CC: David Christensen <[email protected]> for Feedback requested from ARM and PPC maintainers as to this change and what flags, if any, need to be in the .pc file for DPDK on such
platforms. For example - is setting 'pkg_config_machine_args' to
'machine_args' by default necessary behaviour?
Quoted 1 line
Ping for further thoughts or input on this patch.
On initial inspection I don't see any additional value for PPC systems.
Selection of a CPU through -mcpu implies a full ISA for that CPU,
including things like vector extensions, at least with respect to the minimum supported POWER8 CPU (ISA 2.07) and later ISAs. The values of machine_args and pkg_config_machine_args should be identical in all cases I can think of.
If a third party OpenPOWER CPU comes along some time in the future then the requirements may change.
Dave
Quoted 39 lines · David Christensen
Quoted 35 lines · Bruce Richardson
Quoted 33 lines · Bruce Richardson
Traditionally any apps built using DPDK had to support the same instruction sets as supported when the DPDK SDK itself was built, since that was "leaked" through to the end-app and DPDK headers via RTE_MACHINE_CPUFLAG_* values. Therefore, when converting over to meson for app build correctness the "-march=" flag was included in the pkg-config cflags output.
However, since the DPDK-specific CPU flags are now obsolete, and we instead check directly for compiler-defined flags, we should no longer need to force the exact same architecture match in all cases. To faciliate such flexibility, a new
pkg_config_machine_argsarray - which defaults to the existingmachine_argsarray has been defined. The individual architectures - x86, arm and ppc - can choose if and how to override this value themselves.For x86, since SSE4.2 is the minimum instruction-set level needed to run DPDK, and since some header files assume that minimum level of instruction set support, we override the "-march=" value with "-msse4" for the pkg-config file. This allows end applications to set their own "march" value while still ensuring valid DPDK compilation.
Signed-off-by Bruce Richardson <[email protected]>---
CC: Jerin Jacob <[email protected]>
CC: Ruifeng Wang <[email protected]>
CC: Honnappa Nagarahalli <[email protected]>
CC: David Christensen <[email protected]> for Feedback requested from ARM and PPC maintainers as to this change and what flags, if any, need to be in the .pc file for DPDK on such platforms. For example - is setting 'pkg_config_machine_args' to 'machine_args' by default necessary behaviour?
Quoted 1 line
Quoted 1 line
Ping for further thoughts or input on this patch.
Armv8 has dedicated config(taken least cpu flags which supports all armv8) for this purpose config/arm/arm64_armv8_linux_gcc. So this change looks good to me. @Ruifeng Wang (Arm Technology China) Any comments?
Quoted 16 lines
On initial inspection I don't see any additional value for PPC systems.
Selection of a CPU through -mcpu implies a full ISA for that CPU,
including things like vector extensions, at least with respect to the minimum supported POWER8 CPU (ISA 2.07) and later ISAs. The values ofmachine_argsandpkg_config_machine_argsshould be identical in all cases I can think of.If a third party OpenPOWER CPU comes along some time in the future then the requirements may change.
Dave
Quoted 56 lines
-----Original Message-----
From: Jerin Jacob <[email protected]>
Sent: Thursday, September 16, 2021 11:43 AM
To: David Christensen <[email protected]>
Cc: Bruce Richardson <[email protected]>; dpdk-dev <[email protected]>; Luca Boccassi <[email protected]>; David Marchand <[email protected]>; [email protected]; Ilya Maximets <[email protected]>; [email protected]; Ruifeng Wang <[email protected]>; Honnappa Nagarahalli <[email protected]>; Ananyev, Konstantin <[email protected]>; Ferruh Yigit <[email protected]>
Subject: Re: [dpdk-dev] [RFC PATCH] build/pkg-config: remove machine arch flagQuoted 20 lines · David Christensen
Quoted 16 lines · Bruce Richardson
Quoted 15 lines · Bruce Richardson
Traditionally any apps built using DPDK had to support the same instruction sets as supported when the DPDK SDK itself was built, since that was "leaked" through to the end-app and DPDK headers via RTE_MACHINE_CPUFLAG_* values. Therefore, when converting over to meson for app build correctness the "-march=" flag was included in the pkg-config cflags output.
However, since the DPDK-specific CPU flags are now obsolete, and we instead check directly for compiler-defined flags, we should no longer need to force the exact same architecture match in all cases. To faciliate such flexibility, a new
pkg_config_machine_argsarray - which defaults to the existingmachine_argsarray has been defined. The individual architectures - x86, arm and ppc - can choose if and how to override this value themselves.Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
For x86, since SSE4.2 is the minimum instruction-set level needed to run DPDK, and since some header files assume that minimum level of instruction set support, we override the "-march=" value with "-
msse4"
Quoted 16 lines
Quoted 16 lines
Quoted 15 lines
for the pkg-config file. This allows end applications to set their own "march" value while still ensuring valid DPDK compilation.
Signed-off-by Bruce Richardson <[email protected]>---
CC: Jerin Jacob <[email protected]>
CC: Ruifeng Wang <[email protected]>
CC: Honnappa Nagarahalli <[email protected]>
CC: David Christensen <[email protected]> for Feedback requested from ARM and PPC maintainers as to this change and what flags, if any, need to be in the .pc file for DPDK on such platforms. For example - is setting 'pkg_config_machine_args' to 'machine_args' by default necessary behaviour?
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Ping for further thoughts or input on this patch.
Armv8 has dedicated config(taken least cpu flags which supports all armv8) for this purpose config/arm/arm64_armv8_linux_gcc. So this change looks good to me. @Ruifeng Wang (Arm Technology China) Any comments?
Agree. For distro build, only armv8-a is requested. The change looks fine.
Thanks,
Ruifeng
Quoted 17 lines
Quoted 17 lines
On initial inspection I don't see any additional value for PPC systems.
Selection of a CPU through -mcpu implies a full ISA for that CPU,
including things like vector extensions, at least with respect to the minimum supported POWER8 CPU (ISA 2.07) and later ISAs. The values ofmachine_argsandpkg_config_machine_argsshould be identical in all cases I can think of.If a third party OpenPOWER CPU comes along some time in the future then the requirements may change.
Dave
Quoted 78 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Ruifeng Wang
Sent: Thursday, September 16, 2021 6:17 PM
To: Jerin Jacob <[email protected]>; David Christensen <[email protected]>
Cc: Bruce Richardson <[email protected]>; dpdk-dev <[email protected]>; Luca Boccassi <[email protected]>; David Marchand <[email protected]>; [email protected]; Ilya Maximets <[email protected]>; [email protected]; Honnappa Nagarahalli <[email protected]>; Ananyev, Konstantin <[email protected]>; Ferruh Yigit <[email protected]>; nd <[email protected]>
Subject: Re: [dpdk-dev] [RFC PATCH] build/pkg-config: remove machine arch flagQuoted 14 lines
-----Original Message-----
From: Jerin Jacob <[email protected]>
Sent: Thursday, September 16, 2021 11:43 AM
To: David Christensen <[email protected]>
Cc: Bruce Richardson <[email protected]>; dpdk-dev <[email protected]>; Luca Boccassi <[email protected]>; David Marchand <[email protected]>; [email protected]; Ilya Maximets <[email protected]>; [email protected]; Ruifeng Wang <[email protected]>; Honnappa Nagarahalli <[email protected]>; Ananyev, Konstantin <[email protected]>; Ferruh Yigit <[email protected]>
Subject: Re: [dpdk-dev] [RFC PATCH] build/pkg-config: remove machine arch flagQuoted 13 lines
Quoted 10 lines · David Christensen
Quoted 6 lines · Bruce Richardson
Quoted 5 lines · Bruce Richardson
Traditionally any apps built using DPDK had to support the same instruction sets as supported when the DPDK SDK itself was built, since that was "leaked" through to the end-app and DPDK headers via
RTE_MACHINE_CPUFLAG_* values. Therefore, when converting overto
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
meson for app build correctness the "-march=" flag was included in the pkg-config cflags output.
However, since the DPDK-specific CPU flags are now obsolete, and we instead check directly for compiler-defined flags, we should no longer need to force the exact same architecture match in all cases. To faciliate such flexibility, a new
pkg_config_machine_argsarray - which defaults to the existingmachine_argsarray has been defined. The individual architectures
- x86, arm and ppc - can choose if and how to override this valuethemselves.
Quoted 24 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
For x86, since SSE4.2 is the minimum instruction-set level needed to run DPDK, and since some header files assume that minimum level of instruction set support, we override the "-march=" value with "-
msse4"
Quoted 17 lines
Quoted 17 lines
Quoted 6 lines
for the pkg-config file. This allows end applications to set their own "march" value while still ensuring valid DPDK compilation.
Signed-off-by Bruce Richardson <[email protected]>---
Quoted 9 lines
CC: Jerin Jacob <[email protected]>
CC: Ruifeng Wang <[email protected]>
CC: Honnappa Nagarahalli <[email protected]>
CC: David Christensen <[email protected]> for Feedback requested from ARM and PPC maintainers as to this change and what flags, if any, need to be in the .pc file for DPDK on such platforms. For example - is setting 'pkg_config_machine_args' to 'machine_args' by default necessary behaviour?Ping for further thoughts or input on this patch.
Quoted 7 lines
Quoted 5 lines
Armv8 has dedicated config(taken least cpu flags which supports all armv8) for this purpose config/arm/arm64_armv8_linux_gcc. So this change looks good to me. @Ruifeng Wang (Arm Technology China) Any comments?
Agree. For distro build, only armv8-a is requested. The change looks fine.
This is fine if "cross-file" is provided when doing distro build.
However, when "-Dmachine=default"/"-Dplatform=default" is used instead of "cross-file" to do distro build, current change in config/meson.build will lead to " pkg_config_machine_args = -march=generic". This is because generic build is handled by subsequent arch specific config on Arm.
I think moving the change in config/meson.build down below line #307 subdir(arch_subdir) will address aforementioned issue. As by the time, machine_args has been updated with proper value.
Quoted 20 lines
Thanks,
RuifengQuoted 17 lines
Quoted 17 lines
On initial inspection I don't see any additional value for PPC systems.
Selection of a CPU through -mcpu implies a full ISA for that CPU,
including things like vector extensions, at least with respect to the minimum supported POWER8 CPU (ISA 2.07) and later ISAs. The values ofmachine_argsandpkg_config_machine_argsshould be identical in all cases I can think of.If a third party OpenPOWER CPU comes along some time in the future then the requirements may change.
Dave
Quoted 15 lines · On Fri, 11 Dec 2020 15:51:11 +0000 Bruce Richardson…
Traditionally any apps built using DPDK had to support the same instruction sets as supported when the DPDK SDK itself was built, since that was "leaked" through to the end-app and DPDK headers via RTE_MACHINE_CPUFLAG_* values. Therefore, when converting over to meson for app build correctness the "-march=" flag was included in the pkg-config cflags output.
However, since the DPDK-specific CPU flags are now obsolete, and we instead check directly for compiler-defined flags, we should no longer need to force the exact same architecture match in all cases. To faciliate such flexibility, a new
pkg_config_machine_argsarray - which defaults to the existingmachine_argsarray has been defined. The individual architectures - x86, arm and ppc - can choose if and how to override this value themselves.
Quoted 7 lines
For x86, since SSE4.2 is the minimum instruction-set level needed to run DPDK, and since some header files assume that minimum level of instruction set support, we override the "-march=" value with "-msse4" for the pkg-config file. This allows end applications to set their own "march" value while still ensuring valid DPDK compilation.
Signed-off-by Bruce Richardson <[email protected]>
This looks fine, and can see no negatives in the comments. Could you rebase and resubmit a new version if still relevant?
Quoted 24 lines · Stephen Hemminger
Quoted 21 lines · On Fri, 11 Dec 2020 15:51:11 +0000 Bruce Richardson…
Traditionally any apps built using DPDK had to support the same instruction sets as supported when the DPDK SDK itself was built, since that was "leaked" through to the end-app and DPDK headers via RTE_MACHINE_CPUFLAG_* values. Therefore, when converting over to meson for app build correctness the "-march=" flag was included in the pkg-config cflags output.
However, since the DPDK-specific CPU flags are now obsolete, and we instead check directly for compiler-defined flags, we should no longer need to force the exact same architecture match in all cases. To faciliate such flexibility, a new
pkg_config_machine_argsarray - which defaults to the existingmachine_argsarray has been defined. The individual architectures - x86, arm and ppc - can choose if and how to override this value themselves.For x86, since SSE4.2 is the minimum instruction-set level needed to run DPDK, and since some header files assume that minimum level of instruction set support, we override the "-march=" value with "-msse4" for the pkg-config file. This allows end applications to set their own "march" value while still ensuring valid DPDK compilation.
Quoted 5 lines
Quoted 1 line
Signed-off-by Bruce Richardson <[email protected]>This looks fine, and can see no negatives in the comments. Could you rebase and resubmit a new version if still relevant?
There seemed to be a general lack of interest in it, sadly, so not sure I'll resubmit.