From 2b7a4057aa72b1e9963283a01355885db044be08 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 15 Nov 2018 09:55:45 +0100 Subject: [PATCH] update build fixes to upstream submitted v4 Change-Id: Iaa30d7e82ef5e87c0175dc2e5a566a63abe7f8e3 Signed-off-by: Christian Ehrhardt --- ...ld-avoid-non-supported-march-on-ppc-meson.patch | 42 +++++++++++++ ...build-establish-an-invariant-machine-type.patch | 69 ++++++++++++++++++++++ debian/patches/fix-build-arch-defaults.patch | 39 ------------ debian/patches/series | 3 +- 4 files changed, 113 insertions(+), 40 deletions(-) create mode 100644 debian/patches/0001-build-avoid-non-supported-march-on-ppc-meson.patch create mode 100644 debian/patches/0002-build-establish-an-invariant-machine-type.patch delete mode 100644 debian/patches/fix-build-arch-defaults.patch diff --git a/debian/patches/0001-build-avoid-non-supported-march-on-ppc-meson.patch b/debian/patches/0001-build-avoid-non-supported-march-on-ppc-meson.patch new file mode 100644 index 00000000..d6deca59 --- /dev/null +++ b/debian/patches/0001-build-avoid-non-supported-march-on-ppc-meson.patch @@ -0,0 +1,42 @@ +From b43de46c21b7691c087e980f67814e4c59d2213c Mon Sep 17 00:00:00 2001 +From: Christian Ehrhardt +Date: Wed, 14 Nov 2018 12:12:45 +0100 +Subject: [PATCH 1/2] build: avoid non supported -march on ppc (meson) + +So far only if machine was "native" it did use the re-direction to +not set -march on ppc64 (where -march is not supported). +We have to use mcpu/mtune in any case on ppc for whatever someone using +the build system defines as machine. + +Fixes: 54d609a13876 ("build: add ppc64 meson build") + +Acked-by: Luca Boccassi +Signed-off-by: Christian Ehrhardt + +Forwarded: yes +Author: Christian Ehrhardt +Last-Update: 2018-11-15 + +--- + config/meson.build | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/config/meson.build b/config/meson.build +index 0b710b795..1af305f46 100644 +--- a/config/meson.build ++++ b/config/meson.build +@@ -9,8 +9,9 @@ else + endif + dpdk_conf.set('RTE_MACHINE', machine) + machine_args = [] +-# ppc64 does not support -march=native +-if host_machine.cpu_family().startswith('ppc') and machine == 'native' ++ ++# ppc64 does not support -march= at all, use -mcpu and -mtune for that ++if host_machine.cpu_family().startswith('ppc') + machine_args += '-mcpu=' + machine + machine_args += '-mtune=' + machine + else +-- +2.17.1 + diff --git a/debian/patches/0002-build-establish-an-invariant-machine-type.patch b/debian/patches/0002-build-establish-an-invariant-machine-type.patch new file mode 100644 index 00000000..288f7044 --- /dev/null +++ b/debian/patches/0002-build-establish-an-invariant-machine-type.patch @@ -0,0 +1,69 @@ +From e12f30d265ff63a8c9164546355f9ff42abafd50 Mon Sep 17 00:00:00 2001 +From: Christian Ehrhardt +Date: Wed, 14 Nov 2018 12:22:35 +0100 +Subject: [PATCH 2/2] build: establish an invariant machine type + +Add the machine definition 'default' which is special compared +to 'native' (most optimized for current system) or any explicit +type (external entity has to decide on the type). + +It defaults to the per arch agreed common minimal baseline +needed for DPDK to reasonable work. + +That might not be the most optimized, but the most portable +version while still being able to support the CPU features +required for DPDK. + +Going forward this can be bumped up by the DPDK project, but it +can never be an invariant like 'native'. + +Distributions and other needing portable code are expected to +define the machine as 'default'. + +Acked-by: Bruce Richardson +Acked-by: Luca Boccassi +Signed-off-by: Christian Ehrhardt + +Forwarded: yes +Author: Christian Ehrhardt +Last-Update: 2018-11-15 + +--- + config/meson.build | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +diff --git a/config/meson.build b/config/meson.build +index 1af305f46..db32499b3 100644 +--- a/config/meson.build ++++ b/config/meson.build +@@ -7,6 +7,27 @@ if meson.is_cross_build() + else + machine = get_option('machine') + endif ++ ++# machine type 'default' is special, it defaults to the per arch agreed common ++# minimal baseline needed for DPDK. ++# That might not be the most optimized, but the most portable version while ++# still being able to support the CPU features required for DPDK. ++# This can be bumped up by the DPDK project, but it can never be an ++# invariant like 'native' ++if machine == 'default' ++ if host_machine.cpu_family().startswith('x86') ++ # matches the old pre-meson build systems default ++ machine = 'corei7' ++ elif host_machine.cpu_family().startswith('arm') ++ machine = 'armv7-a' ++ elif host_machine.cpu_family().startswith('aarch') ++ # arm64 manages defaults in config/arm/meson.build ++ machine = 'default' ++ elif host_machine.cpu_family().startswith('ppc') ++ machine = 'power8' ++ endif ++endif ++ + dpdk_conf.set('RTE_MACHINE', machine) + machine_args = [] + +-- +2.17.1 + diff --git a/debian/patches/fix-build-arch-defaults.patch b/debian/patches/fix-build-arch-defaults.patch deleted file mode 100644 index e215b2ac..00000000 --- a/debian/patches/fix-build-arch-defaults.patch +++ /dev/null @@ -1,39 +0,0 @@ -Description: Fix build and optimization issues - it is an upstream decision to select the minimum - baseline, also ppc can never use -march -Forwarded: no (planned if it works well) -Author: Christian Ehrhardt -Last-Update: 2018-11-14 ---- a/config/meson.build -+++ b/config/meson.build -@@ -7,10 +7,28 @@ if meson.is_cross_build() - else - machine = get_option('machine') - endif -+ -+# machine type 'base' defaults to the per arch agreed common minimal baseline -+# That might not be the most optimized, but the most portable version while -+# still being able to support the cpu features required for DPDK. -+# This can be bumped, but it can never be an invariant like 'native' -+if machine == 'base' -+ if host_machine.cpu_family().startswith('x86') -+ # matches the old build systems default -+ machine = 'corei7' -+ elif host_machine.cpu_family().startswith('arm') or host_machine.cpu_family().startswith('aarch') -+ # arm manages defaults in config/arm/meson.build -+ machine = 'default' -+ elif host_machine.cpu_family().startswith('ppc') -+ machine = 'power8' -+ endif -+endif -+ - dpdk_conf.set('RTE_MACHINE', machine) - machine_args = [] --# ppc64 does not support -march=native --if host_machine.cpu_family().startswith('ppc') and machine == 'native' -+ -+# ppc64 does not support -march= at all, use -mcpu and -mtune for that -+if host_machine.cpu_family().startswith('ppc') - machine_args += '-mcpu=' + machine - machine_args += '-mtune=' + machine - else diff --git a/debian/patches/series b/debian/patches/series index cdcf78ac..e4b9e681 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ -fix-build-arch-defaults.patch +0001-build-avoid-non-supported-march-on-ppc-meson.patch +0002-build-establish-an-invariant-machine-type.patch -- 2.16.6