build: alias default build as generic

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>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
This commit is contained in:
Juraj Linkeš 2021-03-30 08:40:19 +02:00 committed by Thomas Monjalon
parent 720dfda455
commit 5b3a6ca6fd
6 changed files with 22 additions and 20 deletions

View File

@ -77,7 +77,7 @@ else
OPTS="$OPTS -Dexamples=all" OPTS="$OPTS -Dexamples=all"
fi fi
OPTS="$OPTS -Dmachine=default" OPTS="$OPTS -Dmachine=generic"
OPTS="$OPTS --default-library=$DEF_LIB" OPTS="$OPTS --default-library=$DEF_LIB"
OPTS="$OPTS --buildtype=debugoptimized" OPTS="$OPTS --buildtype=debugoptimized"
OPTS="$OPTS -Dcheck_includes=true" OPTS="$OPTS -Dcheck_includes=true"

View File

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017 Intel Corporation. # Copyright(c) 2017 Intel Corporation.
# Copyright(c) 2017 Cavium, Inc # Copyright(c) 2017 Cavium, Inc
# Copyright(c) 2021 PANTHEON.tech s.r.o.
# common flags to all aarch64 builds, with lowest priority # common flags to all aarch64 builds, with lowest priority
flags_common = [ flags_common = [
@ -208,8 +209,8 @@ if dpdk_conf.get('RTE_ARCH_32')
else else
# aarch64 build # aarch64 build
if not meson.is_cross_build() if not meson.is_cross_build()
if machine == 'default' if machine == 'generic'
# default build # generic build
implementer_id = 'generic' implementer_id = 'generic'
part_number = 'generic' part_number = 'generic'
else else
@ -256,7 +257,7 @@ else
'(-Dmachine=generic) build.') '(-Dmachine=generic) build.')
endif endif
# use default flags with implementer flags # use common flags with implementer flags
dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', []) dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', [])
# apply supported machine args # apply supported machine args

View File

@ -70,21 +70,22 @@ else
machine = get_option('machine') machine = get_option('machine')
endif endif
# machine type 'default' is special, it defaults to the per arch agreed common # machine type 'generic' is special, it selects the per arch agreed common
# minimal baseline needed for DPDK. # 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 # That might not be the most optimized, but the most portable version while
# still being able to support the CPU features required for DPDK. # 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 # This can be bumped up by the DPDK project, but it can never be an
# invariant like 'native' # invariant like 'native'
if machine == 'default' if machine == 'default' or machine == 'generic'
if host_machine.cpu_family().startswith('x86') 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' machine = 'corei7'
elif host_machine.cpu_family().startswith('arm') elif host_machine.cpu_family().startswith('arm')
machine = 'armv7-a' machine = 'armv7-a'
elif host_machine.cpu_family().startswith('aarch') elif host_machine.cpu_family().startswith('aarch')
# arm64 manages defaults in config/arm/meson.build # arm64 manages generic config in config/arm/meson.build
machine = 'default' machine = 'generic'
elif host_machine.cpu_family().startswith('ppc') elif host_machine.cpu_family().startswith('ppc')
machine = 'power8' machine = 'power8'
endif endif

View File

@ -223,12 +223,12 @@ done
# test compilation with minimal x86 instruction set # test compilation with minimal x86 instruction set
# Set the install path for libraries to "lib" explicitly to prevent problems # 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. # with pkg-config prefixes if installed in "lib/x86_64-linux-gnu" later.
default_machine='nehalem' generic_machine='nehalem'
if ! check_cc_flags "-march=$default_machine" ; then if ! check_cc_flags "-march=$generic_machine" ; then
default_machine='corei7' generic_machine='corei7'
fi fi
build build-x86-default cc skipABI -Dcheck_includes=true \ build build-x86-generic cc skipABI -Dcheck_includes=true \
-Dlibdir=lib -Dmachine=$default_machine $use_shared -Dlibdir=lib -Dmachine=$generic_machine $use_shared
# 32-bit with default compiler # 32-bit with default compiler
if check_cc_flags '-m32' ; then if check_cc_flags '-m32' ; then
@ -271,10 +271,10 @@ for f in $srcdir/config/ppc/ppc* ; do
build $targetdir $f ABI $use_shared build $targetdir $f ABI $use_shared
done 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 # the sample apps build using the pkg-config file for cflags and libs
load_env cc 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 export DESTDIR=$build_path/install
install_target $build_path $DESTDIR install_target $build_path $DESTDIR
pc_file=$(find $DESTDIR -name libdpdk.pc) pc_file=$(find $DESTDIR -name libdpdk.pc)

View File

@ -85,7 +85,7 @@ Project-specific options are passed used -Doption=value::
meson -Denable_docs=true fullbuild # build and install docs 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 meson -Ddisable_drivers=event/*,net/tap # disable tap driver and all
# eventdev PMDs for a smaller build # 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. re-scan from meson.
.. note:: .. 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. regardless of the capabilities of the machine where the build is happening.
As well as those settings taken from ``meson configure``, other options As well as those settings taken from ``meson configure``, other options

View File

@ -25,7 +25,7 @@ option('include_subdir_arch', type: 'string', value: '',
option('kernel_dir', type: 'string', value: '', option('kernel_dir', type: 'string', value: '',
description: 'Path to the kernel for building kernel modules. Headers must be in $kernel_dir or $kernel_dir/build. Modules will be installed in /lib/modules.') description: 'Path to the kernel for building kernel modules. Headers must be in $kernel_dir or $kernel_dir/build. Modules will be installed in /lib/modules.')
option('machine', type: 'string', value: 'native', option('machine', type: 'string', value: 'native',
description: 'set the target machine type') description: 'set the target machine type or "generic", a build usable on all machines of the build machine architecture or "native", which lets the compiler pick the architecture of the build machine.')
option('max_ethports', type: 'integer', value: 32, option('max_ethports', type: 'integer', value: 32,
description: 'maximum number of Ethernet devices') description: 'maximum number of Ethernet devices')
option('max_lcores', type: 'integer', value: 128, option('max_lcores', type: 'integer', value: 128,