From f71ccc5691257bc3ff69b7b5de10e9b23689eda8 Mon Sep 17 00:00:00 2001 From: Alexey Marchuk Date: Thu, 16 Jul 2020 12:59:30 +0300 Subject: [PATCH] make/dpdk: Suppress GCC 10 warnings Suppres the following warnings which causes compilation errors: 1. gcc 10 complains on operations with zero size arrays in rte_cryptodev.c Suppress this warning by adding -Wno-stringop-overflow compilation flag 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 sevral translation units. Add -fcommon compilation flag. Fixes issue #1493 Change-Id: I9241bf1fd78e86df6a6eb46b4ff787b2f7027b7d Signed-off-by: Alexey Marchuk (cherry-picked from commit 970c6d099e3db9ca67b19d8cdb56273da6818735) Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5526 Tested-by: Tomasz Zawadzki Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Shuhei Matsumoto Reviewed-by: Jim Harris --- dpdkbuild/Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dpdkbuild/Makefile b/dpdkbuild/Makefile index 63def05d0..ee4f9ae3b 100644 --- a/dpdkbuild/Makefile +++ b/dpdkbuild/Makefile @@ -140,6 +140,18 @@ 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),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 sevral +#translation units +DPDK_CFLAGS += -Wno-stringop-overflow -fcommon +endif +endif + $(SPDK_ROOT_DIR)/dpdk/build: $(SPDK_ROOT_DIR)/mk/cc.mk $(SPDK_ROOT_DIR)/include/spdk/config.h $(Q)rm -rf $(SPDK_ROOT_DIR)/dpdk/build $(Q)$(MAKE) -C $(SPDK_ROOT_DIR)/dpdk config T=$(DPDK_CONFIG) $(DPDK_OPTS)