aboutsummaryrefslogtreecommitdiffstats
path: root/config/meson.build
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2018-11-19 12:59:01 +0000
committerLuca Boccassi <luca.boccassi@gmail.com>2018-11-19 12:59:24 +0000
commit29058550643267a554e0368806dece63b047c5cb (patch)
treea6f573fe3fbc14585529b83cfcc65da2dceefbf5 /config/meson.build
parent8a853e3f0275efc8b05cb195085d45946942744a (diff)
New upstream version 18.11-rc4upstream/18.11-rc4
Change-Id: I861e1a2f7df210f57f44f1ad56b9ef789a4675e3 Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'config/meson.build')
-rw-r--r--config/meson.build26
1 files changed, 24 insertions, 2 deletions
diff --git a/config/meson.build b/config/meson.build
index 0b710b79..db32499b 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -7,10 +7,32 @@ 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 = []
-# 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