[v1,1/1] build: alias default build as generic
Checks
Commit Message
The current machine='default' build name is not descriptive. The actual
default build is machine='native'. Add an alternative string which does
the same build and better describes what we're building:
machine='generic'. Leave machine='default' for backwards compatibility.
Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
config/arm/meson.build | 5 +++--
config/meson.build | 13 +++++++------
devtools/test-meson-builds.sh | 12 ++++++------
doc/guides/prog_guide/build-sdk-meson.rst | 4 ++--
meson_options.txt | 2 +-
5 files changed, 19 insertions(+), 17 deletions(-)
@@ -1,12 +1,13 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017 Intel Corporation.
# Copyright(c) 2017 Cavium, Inc
+# Copyright(c) 2020 PANTHEON.tech s.r.o.
# for checking defines we need to use the correct compiler flags
march_opt = '-march=@0@'.format(machine)
arm_force_native_march = false
-arm_force_default_march = (machine == 'default')
+arm_force_generic_march = (machine == 'generic')
flags_common_default = [
# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -148,7 +149,7 @@ else
cmd_generic = ['generic', '', '', 'default', '']
cmd_output = cmd_generic # Set generic by default
machine_args = [] # Clear previous machine args
- if arm_force_default_march and not meson.is_cross_build()
+ if arm_force_generic_march and not meson.is_cross_build()
machine = impl_generic
impl_pn = 'default'
elif not meson.is_cross_build()
@@ -70,21 +70,22 @@ else
machine = get_option('machine')
endif
-# machine type 'default' is special, it defaults to the per arch agreed common
-# minimal baseline needed for DPDK.
+# machine type 'generic' is special, it selects the per arch agreed common
+# minimal baseline needed for DPDK. Machine type 'default' is also supported
+# with the same meaning for backwards compatibility.
# 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 machine == 'default' or machine == 'generic'
if host_machine.cpu_family().startswith('x86')
- # matches the old pre-meson build systems default
+ # matches the old pre-meson build systems generic machine
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'
+ # arm64 manages generic config in config/arm/meson.build
+ machine = 'generic'
elif host_machine.cpu_family().startswith('ppc')
machine = 'power8'
endif
@@ -209,11 +209,11 @@ done
# test compilation with minimal x86 instruction set
# Set the install path for libraries to "lib" explicitly to prevent problems
# with pkg-config prefixes if installed in "lib/x86_64-linux-gnu" later.
-default_machine='nehalem'
-if ! check_cc_flags "-march=$default_machine" ; then
- default_machine='corei7'
+generic_machine='nehalem'
+if ! check_cc_flags "-march=$generic_machine" ; then
+ generic_machine='corei7'
fi
-build build-x86-default cc -Dlibdir=lib -Dmachine=$default_machine $use_shared
+build build-x86-generic cc -Dlibdir=lib -Dmachine=$generic_machine $use_shared
# 32-bit with default compiler
if check_cc_flags '-m32' ; then
@@ -253,10 +253,10 @@ for f in $srcdir/config/ppc/ppc* ; do
build build-$(basename $f | cut -d'-' -f-2) $f $use_shared
done
-# Test installation of the x86-default target, to be used for checking
+# Test installation of the x86-generic target, to be used for checking
# the sample apps build using the pkg-config file for cflags and libs
load_env cc
-build_path=$(readlink -f $builds_dir/build-x86-default)
+build_path=$(readlink -f $builds_dir/build-x86-generic)
export DESTDIR=$build_path/install
# No need to reinstall if ABI checks are enabled
if [ -z "$DPDK_ABI_REF_VERSION" ]; then
@@ -85,7 +85,7 @@ Project-specific options are passed used -Doption=value::
meson -Denable_docs=true fullbuild # build and install docs
- meson -Dmachine=default # use builder-independent baseline -march
+ meson -Dmachine=generic # use builder-independent baseline -march
meson -Ddisable_drivers=event/*,net/tap # disable tap driver and all
# eventdev PMDs for a smaller build
@@ -114,7 +114,7 @@ Examples of setting some of the same options using meson configure::
re-scan from meson.
.. note::
- machine=default uses a config that works on all supported architectures
+ machine=generic uses a config that works on all supported architectures
regardless of the capabilities of the machine where the build is happening.
As well as those settings taken from ``meson configure``, other options
@@ -21,7 +21,7 @@ option('kernel_dir', type: 'string', value: '',
option('lib_musdk_dir', type: 'string', value: '',
description: 'path to the MUSDK library installation directory')
option('machine', type: 'string', value: 'native',
- description: 'set the target machine type')
+ description: 'set the target machine type. Special values: 'generic' is a build usable on all machines of the build machine architecture, 'native' lets the compiler pick the architecture of the build machine.')
option('max_ethports', type: 'integer', value: 32,
description: 'maximum number of Ethernet devices')
option('max_lcores', type: 'integer', value: 128,