From 6e9cf0c7b4f15501b65dd71e5b3cfd6341767903 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Wed, 8 Jun 2022 00:44:22 +0000 Subject: [PATCH] test: add ENV_CFLAGS after includes DPDK CFLAGS get put into CFLAGS in mk/cc.flags.mk, which for system package installed DPDK will include extra paths like /usr/include//dpdk. If a Makefile adds its own CFLAGS before including the .mk fragment that pulls in these CFLAGS, we won't actually get those cc.flags.mk applied since they are defined with ?=. This may need to be revisited - using ?= for these has evolved through several iterations of our SPDK configured flag files - starting with commit 08ec96eb. But for now, let's just fix these few Makefiles. Fixes issue #2548. Signed-off-by: Jim Harris Change-Id: I9863db1b37b31907b4088f58cc13b81ed1bb8632 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12982 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Konrad Sztyber --- test/env/env_dpdk_post_init/Makefile | 3 ++- test/env/memory/Makefile | 5 +++-- test/env/pci/Makefile | 3 ++- test/unit/lib/vhost/vhost.c/Makefile | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/test/env/env_dpdk_post_init/Makefile b/test/env/env_dpdk_post_init/Makefile index ce97a7737..4887ee0fe 100644 --- a/test/env/env_dpdk_post_init/Makefile +++ b/test/env/env_dpdk_post_init/Makefile @@ -5,7 +5,8 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..) -CFLAGS += $(ENV_CFLAGS) APP = env_dpdk_post_init include $(SPDK_ROOT_DIR)/mk/nvme.libtest.mk + +CFLAGS += $(ENV_CFLAGS) diff --git a/test/env/memory/Makefile b/test/env/memory/Makefile index 99e9759e3..4690af8fe 100644 --- a/test/env/memory/Makefile +++ b/test/env/memory/Makefile @@ -5,8 +5,9 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..) -CFLAGS += $(ENV_CFLAGS) -CFLAGS += -I$(SPDK_ROOT_DIR)/test/lib TEST_FILE = memory_ut.c include $(SPDK_ROOT_DIR)/mk/spdk.unittest.mk + +CFLAGS += $(ENV_CFLAGS) +CFLAGS += -I$(SPDK_ROOT_DIR)/test/lib diff --git a/test/env/pci/Makefile b/test/env/pci/Makefile index ca79d0b82..2e78d7100 100644 --- a/test/env/pci/Makefile +++ b/test/env/pci/Makefile @@ -6,7 +6,8 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..) UNIT_TEST_LINK_ENV = 1 -CFLAGS += $(ENV_CFLAGS) TEST_FILE = pci_ut.c include $(SPDK_ROOT_DIR)/mk/spdk.unittest.mk + +CFLAGS += $(ENV_CFLAGS) diff --git a/test/unit/lib/vhost/vhost.c/Makefile b/test/unit/lib/vhost/vhost.c/Makefile index 0ba848036..9ee8d3f51 100644 --- a/test/unit/lib/vhost/vhost.c/Makefile +++ b/test/unit/lib/vhost/vhost.c/Makefile @@ -6,7 +6,8 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../../..) include $(SPDK_ROOT_DIR)/mk/config.mk -CFLAGS += $(ENV_CFLAGS) TEST_FILE = vhost_ut.c include $(SPDK_ROOT_DIR)/mk/spdk.unittest.mk + +CFLAGS += $(ENV_CFLAGS)