- d/p/fix-build-arch-defaults.patch: fix non x86 compilation and defaults 19/15919/1
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>
Wed, 14 Nov 2018 06:57:08 +0000 (07:57 +0100)
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>
Wed, 14 Nov 2018 07:48:06 +0000 (08:48 +0100)
Change-Id: I87e5bc6ea5313e6a8c48ab8d6a56a152187649cc
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
debian/patches/fix-build-arch-defaults.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/fix-build-arch-defaults.patch b/debian/patches/fix-build-arch-defaults.patch
new file mode 100644 (file)
index 0000000..e215b2a
--- /dev/null
@@ -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
index e69de29..cdcf78a 100644 (file)
@@ -0,0 +1 @@
+fix-build-arch-defaults.patch