From a66fde23d7ecacec17bb2822dc13f94300c84ff0 Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Thu, 21 Jan 2021 06:11:19 -0500 Subject: [PATCH] libvfio-user: set COMMON_CFLAGS for external_code tests Static compilation for external_code tests uses SYS_LIBS that now includes libvfio-user. As such the COMMON_CFLAGS need to point to the build directory. Signed-off-by: Tomasz Zawadzki Change-Id: I6f3aa670a62445088535eacdfa1483bfacd5ce7b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6020 Community-CI: Broadcom CI Reviewed-by: Karol Latecki Reviewed-by: Aleksey Marchuk Tested-by: SPDK CI Jenkins --- test/external_code/Makefile | 4 ++++ test/external_code/test_make.sh | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test/external_code/Makefile b/test/external_code/Makefile index 4a4fb6251..6da3f62fc 100644 --- a/test/external_code/Makefile +++ b/test/external_code/Makefile @@ -44,6 +44,10 @@ endif ifneq ($(DPDK_LIB_DIR),) COMMON_CFLAGS+=-L$(DPDK_LIB_DIR) endif + +ifneq ($(VFIO_LIB_DIR),) +COMMON_CFLAGS+=-L$(VFIO_LIB_DIR) +endif export .PHONY: all diff --git a/test/external_code/test_make.sh b/test/external_code/test_make.sh index 84cbef690..d98cac346 100755 --- a/test/external_code/test_make.sh +++ b/test/external_code/test_make.sh @@ -22,7 +22,8 @@ make -C $SPDK_DIR -j$(nproc) export SPDK_HEADER_DIR="$SPDK_DIR/include" export SPDK_LIB_DIR="$SPDK_DIR/build/lib" export DPDK_LIB_DIR="${SPDK_RUN_EXTERNAL_DPDK:-$SPDK_DIR/dpdk/build}/lib" -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SPDK_LIB_DIR:$DPDK_LIB_DIR:"$test_root/passthru" +export VFIO_LIB_DIR="$SPDK_DIR/libvfio-user/build/release/lib" +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SPDK_LIB_DIR:$DPDK_LIB_DIR:$VFIO_LIB_DIR:"$test_root/passthru" # The default target is to make both the app and bdev and link them against the combined SPDK shared library libspdk.so. run_test "external_make_tc1" make -C $test_root hello_world_bdev_shared_combo