[dpdk-dev] [dpdk-stable] [PATCH] mk: remove library search path from binary

Thomas Monjalon thomas at monjalon.net
Mon Nov 18 16:14:54 CET 2019


12/11/2019 14:15, Ferruh Yigit:
> This patch functionally reverts the patch in fixes line to not have any
> hardcoded library path in the final binary for the security reasons, in
> case this binary distributed to production environment.

What about meson?
There are these rpaths:
	$ORIGIN/../lib
	$ORIGIN/../drivers


> RPATH only added in RTE_DEVEL_BUILD case and this binary shouldn't
> distributed, but still removing it to be cautious.

For convenience, we could keep adding rpath for internal apps.


> --- a/devtools/test-null.sh
> +++ b/devtools/test-null.sh

>  if ldd $testpmd | grep -q librte_ ; then
> +	export LD_LIBRARY_PATH=$build/lib:$LD_LIBRARY_PATH
>  	libs='-d librte_mempool_ring.so -d librte_pmd_null.so'


There is an issue in this change, because $build may be undefined.
It can be fixed with adding this line:

+[ -f "$testpmd" ] && build=$(dirname $(dirname $testpmd))
 [ -f "$testpmd" ] || testpmd=$build/app/dpdk-testpmd
 [ -f "$testpmd" ] || testpmd=$build/app/testpmd





More information about the dev mailing list