From e9438453d4277e1d2f82cf4cd268830f55bb85b6 Mon Sep 17 00:00:00 2001 From: Jacek Kalwas Date: Wed, 31 Aug 2022 11:11:13 -0400 Subject: [PATCH] build: explicitly clear pkg-config sysroot env depending on building environment "pkg-config --variable=libdir" might return absolute path (including sysroot dir) or relative path this has implication for readlink just below which concatenate strings including sysroot dir, if sysroot dir occurs in both vars then readlink will fail and configuration will be terminated it seems like a grey area of pkg-config documentaion, the behavior is not well defined and consistent across pkg-config versions Signed-off-by: Jacek Kalwas Signed-off-by: Lei Li Change-Id: I3ab459632ff656b40f87c42cc7b1527982a33545 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14294 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Reviewed-by: Tomasz Zawadzki Reviewed-by: Ben Walker Reviewed-by: Aleksey Marchuk --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 6a78bf681..57430f676 100755 --- a/configure +++ b/configure @@ -415,7 +415,7 @@ for i in "$@"; do if command -v "pkg-config" > /dev/null 2>&1 && PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$dpdk_libdir/pkgconfig" pkg-config --exists libdpdk; then echo "Using $dpdk_libdir/pkgconfig for additional libs..." sysroot_dir=$(PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$dpdk_libdir/pkgconfig" pkg-config --variable=pc_sysrootdir libdpdk) - dpdk_libdir=$(PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$dpdk_libdir/pkgconfig" pkg-config --variable=libdir libdpdk) + dpdk_libdir=$(PKG_CONFIG_SYSROOT_DIR='' PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$dpdk_libdir/pkgconfig" pkg-config --variable=libdir libdpdk) dpdk_libdir=$(readlink -f "${sysroot_dir}$dpdk_libdir") if ! echo $dpdk_libdir | grep $dpdk_dir > /dev/null 2>&1; then echo "ERROR: pkg-config reported DPDK libdir $dpdk_libdir is out of the directory specified with --with-dpdk="