Commit 3196d976 authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Jim Harris
Browse files

build: move DPDK_CFLAGS initialization to env.mk



Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I2231f2e34d220787807de6e91917be92dd1ead27
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/22054


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarMichal Berger <michal.berger@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 9b6ca4e2
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@ include $(SPDK_ROOT_DIR)/mk/spdk.common.mk

DPDK_OPTS = -Denable_docs=false
DPDK_OPTS += -Dtests=false
DPDK_CFLAGS =

ifeq ($(shell uname -m),aarch64)
ifeq ($(shell uname -p),unknown)
@@ -162,26 +161,6 @@ endif
# Allow users to specify EXTRA_DPDK_CFLAGS if they want to build DPDK using unsupported compiler versions
DPDK_CFLAGS += $(EXTRA_DPDK_CFLAGS)

ifeq ($(CC_TYPE),gcc)
GCC_MAJOR = $(shell echo __GNUC__ | $(CC) -E -x c - | tail -n 1)
ifeq ($(shell test $(GCC_MAJOR) -ge 10 && echo 1), 1)
#1. gcc 10 complains on operations with zero size arrays in rte_cryptodev.c, so
#disable this warning
#2. gcc 10 disables fcommon by default and complains on multiple definition of
#aesni_mb_logtype_driver symbol which is defined in header file and presented in several
#translation units
DPDK_CFLAGS += -Wno-stringop-overflow -fcommon
ifeq ($(shell test $(GCC_MAJOR) -ge 12 && echo 1), 1)
# 3. gcc 12 reports reading incorect size from a region. Seems like false positive,
# see issue #2460
DPDK_CFLAGS += -Wno-stringop-overread
# 4. gcc 12 reports array subscript * is outside array bounds. Seems like false positive,
# see issue #2668
DPDK_CFLAGS += -Wno-array-bounds
endif
endif
endif

# Force-disable scan-build
SUB_CC = $(patsubst %ccc-analyzer,$(DEFAULT_CC),$(CC))

+20 −0
Original line number Diff line number Diff line
@@ -183,6 +183,26 @@ ifeq ($(OS),FreeBSD)
DPDK_PRIVATE_LINKER_ARGS += -lexecinfo
endif

ifeq ($(CC_TYPE),gcc)
GCC_MAJOR = $(shell echo __GNUC__ | $(CC) -E -x c - | tail -n 1)
ifeq ($(shell test $(GCC_MAJOR) -ge 10 && echo 1), 1)
#1. gcc 10 complains on operations with zero size arrays in rte_cryptodev.c, so
#disable this warning
#2. gcc 10 disables fcommon by default and complains on multiple definition of
#aesni_mb_logtype_driver symbol which is defined in header file and presented in several
#translation units
DPDK_CFLAGS += -Wno-stringop-overflow -fcommon
ifeq ($(shell test $(GCC_MAJOR) -ge 12 && echo 1), 1)
# 3. gcc 12 reports reading incorect size from a region. Seems like false positive,
# see issue #2460
DPDK_CFLAGS += -Wno-stringop-overread
# 4. gcc 12 reports array subscript * is outside array bounds. Seems like false positive,
# see issue #2668
DPDK_CFLAGS += -Wno-array-bounds
endif
endif
endif

ifeq ($(CONFIG_SHARED),y)
ENV_DPDK_FILE = $(call spdk_lib_list_to_shared_libs,env_dpdk)
ENV_LIBS = $(ENV_DPDK_FILE) $(DPDK_SHARED_LIB)