From d2f073e03456f64e042eb199c74a9a3487325067 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Wed, 14 Nov 2018 07:57:08 +0100 Subject: [PATCH] - d/p/fix-build-arch-defaults.patch: fix non x86 compilation and defaults Change-Id: I87e5bc6ea5313e6a8c48ab8d6a56a152187649cc Signed-off-by: Christian Ehrhardt --- debian/patches/fix-build-arch-defaults.patch | 39 ++++++++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 40 insertions(+) create mode 100644 debian/patches/fix-build-arch-defaults.patch diff --git a/debian/patches/fix-build-arch-defaults.patch b/debian/patches/fix-build-arch-defaults.patch new file mode 100644 index 00000000..e215b2ac --- /dev/null +++ b/debian/patches/fix-build-arch-defaults.patch @@ -0,0 +1,39 @@ +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 e69de29b..cdcf78ac 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -0,0 +1 @@ +fix-build-arch-defaults.patch -- 2.16.6