Any flags added to the project args are automatically added to all builds,
both native and cross-compiled. This is not what we want for the -march
flag as a valid -march for the cross-compile is not valid for pmdinfogen
which is a native-build tool.
Instead we store the march flag as a variable, and add it to the default
cflags for all libs, drivers, examples, etc. This will allow pmdinfogen to
compile successfully in a cross-compilation environment.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
executable('dpdk-testpmd',
sources,
executable('dpdk-testpmd',
sources,
- c_args: '-DALLOW_EXPERIMENTAL_API',
+ c_args: [machine_arg, '-DALLOW_EXPERIMENTAL_API'],
link_whole: link_libs,
dependencies: dep_objs,
install_rpath: join_paths(get_option('prefix'), driver_install_path),
link_whole: link_libs,
dependencies: dep_objs,
install_rpath: join_paths(get_option('prefix'), driver_install_path),
pmdinfogen = executable('pmdinfogen',
'pmdinfogen.c',
include_directories: pmdinfogen_inc,
pmdinfogen = executable('pmdinfogen',
'pmdinfogen.c',
include_directories: pmdinfogen_inc,
- native: true,
- c_args: cflags)
# Copyright(c) 2017 Intel Corporation
# set the machine type and cflags for it
# Copyright(c) 2017 Intel Corporation
# set the machine type and cflags for it
-machine = get_option('machine')
+if meson.is_cross_build()
+ machine = host_machine.cpu()
+else
+ machine = get_option('machine')
+endif
dpdk_conf.set('RTE_MACHINE', machine)
dpdk_conf.set('RTE_MACHINE', machine)
-add_project_arguments('-march=@0@'.format(machine), language: 'c')
+machine_arg = '-march=' + machine
# use pthreads
add_project_link_arguments('-pthread', language: 'c')
# use pthreads
add_project_link_arguments('-pthread', language: 'c')
- **Default Value = []**.
+ **Default Value = [<-march/-mcpu flags>]**.
Used to specify any additional cflags that need to be passed to compile
the sources in the library.
Used to specify any additional cflags that need to be passed to compile
the sources in the library.
allow_experimental_apis = false
sources = []
objs = []
allow_experimental_apis = false
sources = []
objs = []
includes = [include_directories(drv_path)]
# set up internal deps. Drivers can append/override as necessary
deps = std_deps
includes = [include_directories(drv_path)]
# set up internal deps. Drivers can append/override as necessary
deps = std_deps
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017 Intel Corporation
-cflags = ['-DPF_DRIVER',
+cflags += ['-DPF_DRIVER',
'-DVF_DRIVER',
'-DINTEGRATED_VF',
'-DX722_A0_SUPPORT']
'-DVF_DRIVER',
'-DINTEGRATED_VF',
'-DX722_A0_SUPPORT']
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017 Intel Corporation
-cflags = ['-DRTE_LIBRTE_IXGBE_BYPASS']
+cflags += ['-DRTE_LIBRTE_IXGBE_BYPASS']
subdir('base')
objs = [base_objs]
subdir('base')
objs = [base_objs]
name = example
sources = []
allow_experimental_apis = false
name = example
sources = []
allow_experimental_apis = false
ext_deps = []
includes = [include_directories(example)]
deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
ext_deps = []
includes = [include_directories(example)]
deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
sources = []
headers = []
includes = []
sources = []
headers = []
includes = []
objs = [] # other object files to link against, used e.g. for
# instruction-set optimized versions of code
objs = [] # other object files to link against, used e.g. for
# instruction-set optimized versions of code
['-Wl,-Bdynamic'] + dpdk_extra_ldflags,
description: 'The Data Plane Development Kit (DPDK)',
subdirs: [get_option('include_subdir_arch'), '.'],
['-Wl,-Bdynamic'] + dpdk_extra_ldflags,
description: 'The Data Plane Development Kit (DPDK)',
subdirs: [get_option('include_subdir_arch'), '.'],
- extra_cflags: ['-include', 'rte_config.h', '-march=@0@'.format(machine)]
+ extra_cflags: ['-include', 'rte_config.h', machine_arg]