aboutsummaryrefslogtreecommitdiffstats
path: root/debian/patches/fix-build-arch-defaults.patch
blob: e215b2ac62d9e0df9655329fab53137035d91956 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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