numam-dpdk/app/meson.build
Olivier Matz b031e13d7f build: fix plugin load on static build
When dpdk is compiled as static libraries, it is not possible
to load a plugin from an application. We get the following error:

  EAL: librte_pmd_xxxx.so: undefined symbol: per_lcore__rte_errno

This happens because the dpdk symbols are not exported. Add them to the
dynamic symbol table by using '-Wl,--export-dynamic'. This option was
previously present when compiled with Makefiles, it was introduced in
commit f9a08f6502 ("eal: add support for shared object drivers")

Also add it to the pkg-config file.

Fixes: 16ade738fd ("app/testpmd: build with meson")
Fixes: 89f0711f9d ("examples: build some samples with meson")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
2021-01-05 23:01:36 +01:00

77 lines
1.6 KiB
Meson

# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017-2019 Intel Corporation
if is_windows
subdir_done()
endif
apps = [
'pdump',
'proc-info',
'test-acl',
'test-bbdev',
'test-cmdline',
'test-compress-perf',
'test-crypto-perf',
'test-eventdev',
'test-fib',
'test-flow-perf',
'test-pipeline',
'test-pmd',
'test-regex',
'test-sad']
# for BSD only
lib_execinfo = cc.find_library('execinfo', required: false)
default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API']
default_ldflags = []
if get_option('default_library') == 'static'
default_ldflags += ['-Wl,--export-dynamic']
endif
foreach app:apps
build = true
name = app
sources = []
includes = []
cflags = default_cflags
ldflags = default_ldflags
objs = [] # other object files to link against, used e.g. for
# instruction-set optimized versions of code
# use "deps" for internal DPDK dependencies, and "ext_deps" for
# external package/library requirements
ext_deps = []
deps = []
subdir(name)
if build
dep_objs = []
foreach d:deps
dep_objs += get_variable(get_option('default_library')
+ '_rte_' + d)
endforeach
dep_objs += lib_execinfo
link_libs = []
if get_option('default_library') == 'static'
link_libs = dpdk_static_libraries + dpdk_drivers
endif
executable('dpdk-' + name,
sources,
c_args: cflags,
link_args: ldflags,
link_whole: link_libs,
dependencies: dep_objs,
install_rpath: join_paths(get_option('prefix'),
driver_install_path),
install: true)
endif
endforeach
# special case the autotests
subdir('test')