From de061fe10832fa1aa5d8be0ccb2fc3a0d9ff2317 Mon Sep 17 00:00:00 2001 From: Heinrich Kuhn Date: Fri, 17 Sep 2021 10:46:21 +0200 Subject: [PATCH] CI: set machine type to default when building DPDK As part of building statically linked packages DPDK is also compiled from source. Before this patch the default machine type of "native" was used. This results in DPDK building with -march=native. This isn't very portable and can cause issues on CPU's that don't have feature parity with the build machine's CPU. This patch sets the machine type to "default". On x86 this will conservatively set "-march=corei7" which is a lot more portable than "native" Older versions of DPDK did not export a -march flag in the pkgconfig file. Virtio-forwarder will set the flag to core2. Change this to corei7 for consistency too. Signed-off-by: Heinrich Kuhn Signed-off-by: Simon Horman --- .github/data/build_templates/template.sh | 1 + meson.build | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/data/build_templates/template.sh b/.github/data/build_templates/template.sh index eb9cc6f..ce67739 100755 --- a/.github/data/build_templates/template.sh +++ b/.github/data/build_templates/template.sh @@ -62,6 +62,7 @@ echo "Disabling the following drivers: ${disable_list%,}" meson -Denable_kmods=false \ -Dmax_ethports=64 \ -Ddisable_drivers="${disable_list%,}" \ + -Dmachine=default \ build ninja install -C build && ldconfig diff --git a/meson.build b/meson.build index 60603a5..3060e23 100644 --- a/meson.build +++ b/meson.build @@ -172,11 +172,11 @@ cflags += '-D_GNU_SOURCE' cflags += '-mavx' # older versions of the dpdk pc file did not include the baseline architecture -# set it to DPDK's old default (it has since been moved to corei7 in 17.08) -# this can be dropped once support for DPDK < 18.11 is no longer necessary +# set it to corei7. This can be dropped once support for DPDK < 18.11 +# is no longer necessary dpdk_cflags = dpdk.get_pkgconfig_variable('cflags') if host_machine.cpu_family().startswith('x86') and not dpdk_cflags.contains('-march') - cflags += '-march=core2' + cflags += '-march=corei7' endif sources = files('argv.c',