aboutsummaryrefslogtreecommitdiffstats
path: root/debian
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2018-11-14 07:57:08 +0100
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2018-11-14 08:48:06 +0100
commitd2f073e03456f64e042eb199c74a9a3487325067 (patch)
tree18c434fd4ed8eaaf644a67144c9807c331fce295 /debian
parent781243f8a77836150d25dba31be870df30cc153f (diff)
- d/p/fix-build-arch-defaults.patch: fix non x86 compilation and defaults
Change-Id: I87e5bc6ea5313e6a8c48ab8d6a56a152187649cc Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'debian')
-rw-r--r--debian/patches/fix-build-arch-defaults.patch39
-rw-r--r--debian/patches/series1
2 files changed, 40 insertions, 0 deletions
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 <christian.ehrhardt@canonical.com>
+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