From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id 73B5F199B3 for ; Mon, 11 Dec 2017 20:37:19 +0100 (CET) Received: from cpe-2606-a000-111b-423c-e874-da8e-c543-d863.dyn6.twc.com ([2606:a000:111b:423c:e874:da8e:c543:d863] helo=hmswarspite.think-freely.org) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1eOTst-0006ro-BU; Mon, 11 Dec 2017 14:37:16 -0500 Received: from hmswarspite.think-freely.org (localhost [127.0.0.1]) by hmswarspite.think-freely.org (8.15.2/8.15.2) with ESMTP id vBBJaV4S021736; Mon, 11 Dec 2017 14:36:31 -0500 Received: (from nhorman@localhost) by hmswarspite.think-freely.org (8.15.2/8.15.2/Submit) id vBBJaUXh021735; Mon, 11 Dec 2017 14:36:31 -0500 From: Neil Horman To: dev@dpdk.org Cc: thomas@monjalon.net, john.mcnamara@intel.com, bruce.richardson@intel.com, Neil Horman Date: Mon, 11 Dec 2017 14:36:18 -0500 Message-Id: <20171211193619.21643-4-nhorman@tuxdriver.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171211193619.21643-1-nhorman@tuxdriver.com> References: <20171201185628.16261-1-nhorman@tuxdriver.com> <20171211193619.21643-1-nhorman@tuxdriver.com> X-Spam-Score: -2.9 (--) X-Spam-Status: No Subject: [dpdk-dev] [PATCHv3 3/4] Makefiles: Add experimental tag check and warnings to trigger on use X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Dec 2017 19:37:19 -0000 Add checks during build to ensure that all symbols in the EXPERIMENTAL version map section have __experimental tags on their definitions, and enable the warnings needed to announce their use. Also add an ALLOW_EXPERIMENTAL_APIS define to allow individual libraries and files to declare the acceptability of experimental api usage Signed-off-by: Neil Horman CC: Thomas Monjalon CC: "Mcnamara, John" CC: Bruce Richardson --- app/test-eventdev/Makefile | 1 + app/test-pmd/Makefile | 1 + drivers/event/sw/Makefile | 1 + drivers/net/failsafe/Makefile | 1 + drivers/net/ixgbe/Makefile | 1 + examples/eventdev_pipeline_sw_pmd/Makefile | 1 + examples/flow_classify/Makefile | 1 + examples/ipsec-secgw/Makefile | 1 + examples/service_cores/Makefile | 1 + lib/librte_eal/bsdapp/eal/Makefile | 1 + lib/librte_eal/linuxapp/Makefile | 2 ++ lib/librte_eal/linuxapp/eal/Makefile | 2 ++ lib/librte_eventdev/Makefile | 1 + lib/librte_security/Makefile | 1 + mk/internal/rte.compile-pre.mk | 4 ++++ mk/toolchain/clang/rte.vars.mk | 2 +- mk/toolchain/gcc/rte.vars.mk | 2 +- mk/toolchain/icc/rte.vars.mk | 2 +- 18 files changed, 23 insertions(+), 3 deletions(-) diff --git a/app/test-eventdev/Makefile b/app/test-eventdev/Makefile index dcb2ac476..78bae7633 100644 --- a/app/test-eventdev/Makefile +++ b/app/test-eventdev/Makefile @@ -32,6 +32,7 @@ include $(RTE_SDK)/mk/rte.vars.mk APP = dpdk-test-eventdev +CFLAGS += -DALLOW_EXPERIMENTAL_APIS CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) diff --git a/app/test-pmd/Makefile b/app/test-pmd/Makefile index d21308fcd..23f9ddb86 100644 --- a/app/test-pmd/Makefile +++ b/app/test-pmd/Makefile @@ -38,6 +38,7 @@ ifeq ($(CONFIG_RTE_TEST_PMD),y) # APP = testpmd +CFLAGS += -DALLOW_EXPERIMENTAL_APIS CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) diff --git a/drivers/event/sw/Makefile b/drivers/event/sw/Makefile index 2f2b67bac..e54477ec5 100644 --- a/drivers/event/sw/Makefile +++ b/drivers/event/sw/Makefile @@ -34,6 +34,7 @@ include $(RTE_SDK)/mk/rte.vars.mk LIB = librte_pmd_sw_event.a # build flags +CFLAGS += -DALLOW_EXPERIMENTAL_APIS CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) # for older GCC versions, allow us to initialize an event using diff --git a/drivers/net/failsafe/Makefile b/drivers/net/failsafe/Makefile index ea2a8fe46..29f1f0ff2 100644 --- a/drivers/net/failsafe/Makefile +++ b/drivers/net/failsafe/Makefile @@ -50,6 +50,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_FAILSAFE) += failsafe_flow.c # No exported include files # Basic CFLAGS: +CFLAGS += -DALLOW_EXPERIMENTAL_APIS CFLAGS += -std=gnu99 -Wextra CFLAGS += -O3 CFLAGS += -I. diff --git a/drivers/net/ixgbe/Makefile b/drivers/net/ixgbe/Makefile index 511a64eb0..c1cf226f1 100644 --- a/drivers/net/ixgbe/Makefile +++ b/drivers/net/ixgbe/Makefile @@ -36,6 +36,7 @@ include $(RTE_SDK)/mk/rte.vars.mk # LIB = librte_pmd_ixgbe.a +CFLAGS += -DALLOW_EXPERIMENTAL_APIS CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) diff --git a/examples/eventdev_pipeline_sw_pmd/Makefile b/examples/eventdev_pipeline_sw_pmd/Makefile index de4e22c88..dc54b0df2 100644 --- a/examples/eventdev_pipeline_sw_pmd/Makefile +++ b/examples/eventdev_pipeline_sw_pmd/Makefile @@ -43,6 +43,7 @@ APP = eventdev_pipeline_sw_pmd # all source are stored in SRCS-y SRCS-y := main.c +CFLAGS += -DALLOW_EXPERIMENTAL_APIS CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) diff --git a/examples/flow_classify/Makefile b/examples/flow_classify/Makefile index eecdde14c..905a11cef 100644 --- a/examples/flow_classify/Makefile +++ b/examples/flow_classify/Makefile @@ -45,6 +45,7 @@ APP = flow_classify # all source are stored in SRCS-y SRCS-y := flow_classify.c +CFLAGS += -DALLOW_EXPERIMENTAL_APIS CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) diff --git a/examples/ipsec-secgw/Makefile b/examples/ipsec-secgw/Makefile index 9fd33cb7f..84ba9fd29 100644 --- a/examples/ipsec-secgw/Makefile +++ b/examples/ipsec-secgw/Makefile @@ -46,6 +46,7 @@ endif APP = ipsec-secgw +CFLAGS += -DALLOW_EXPERIMENTAL_APIS CFLAGS += -O3 -gdwarf-2 CFLAGS += $(WERROR_FLAGS) ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y) diff --git a/examples/service_cores/Makefile b/examples/service_cores/Makefile index bd4a345dc..1f0448e27 100644 --- a/examples/service_cores/Makefile +++ b/examples/service_cores/Makefile @@ -43,6 +43,7 @@ APP = service_cores # all source are stored in SRCS-y SRCS-y := main.c +CFLAGS += -DALLOW_EXPERIMENTAL_APIS CFLAGS += $(WERROR_FLAGS) # workaround for a gcc bug with noreturn attribute diff --git a/lib/librte_eal/bsdapp/eal/Makefile b/lib/librte_eal/bsdapp/eal/Makefile index afa117de4..ed595f104 100644 --- a/lib/librte_eal/bsdapp/eal/Makefile +++ b/lib/librte_eal/bsdapp/eal/Makefile @@ -37,6 +37,7 @@ ARCH_DIR ?= $(RTE_ARCH) VPATH += $(RTE_SDK)/lib/librte_eal/common VPATH += $(RTE_SDK)/lib/librte_eal/common/arch/$(ARCH_DIR) +CFLAGS += -DALLOW_EXPERIMENTAL_APIS CFLAGS += -I$(SRCDIR)/include CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include diff --git a/lib/librte_eal/linuxapp/Makefile b/lib/librte_eal/linuxapp/Makefile index 2ebdf3139..37367fc88 100644 --- a/lib/librte_eal/linuxapp/Makefile +++ b/lib/librte_eal/linuxapp/Makefile @@ -36,4 +36,6 @@ DIRS-$(CONFIG_RTE_EAL_IGB_UIO) += igb_uio DIRS-$(CONFIG_RTE_KNI_KMOD) += kni DEPDIRS-kni := eal +CFLAGS += -DALLOW_EXPERIMENTAL_APIS + include $(RTE_SDK)/mk/rte.subdir.mk diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile index 5a7b8b2ac..ec810d92b 100644 --- a/lib/librte_eal/linuxapp/eal/Makefile +++ b/lib/librte_eal/linuxapp/eal/Makefile @@ -34,6 +34,7 @@ include $(RTE_SDK)/mk/rte.vars.mk LIB = librte_eal.a ARCH_DIR ?= $(RTE_ARCH) + EXPORT_MAP := ../../rte_eal_version.map VPATH += $(RTE_SDK)/lib/librte_eal/common/arch/$(ARCH_DIR) @@ -41,6 +42,7 @@ LIBABIVER := 6 VPATH += $(RTE_SDK)/lib/librte_eal/common +CFLAGS += -DALLOW_EXPERIMENTAL_APIS CFLAGS += -I$(SRCDIR)/include CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include diff --git a/lib/librte_eventdev/Makefile b/lib/librte_eventdev/Makefile index 5ac22cde7..96afc3be8 100644 --- a/lib/librte_eventdev/Makefile +++ b/lib/librte_eventdev/Makefile @@ -37,6 +37,7 @@ LIB = librte_eventdev.a LIBABIVER := 3 # build flags +CFLAGS += -DALLOW_EXPERIMENTAL_APIS CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) LDLIBS += -lrte_eal -lrte_ring -lrte_ethdev -lrte_hash diff --git a/lib/librte_security/Makefile b/lib/librte_security/Makefile index bb93ec33d..d433937a5 100644 --- a/lib/librte_security/Makefile +++ b/lib/librte_security/Makefile @@ -37,6 +37,7 @@ LIB = librte_security.a LIBABIVER := 1 # build flags +CFLAGS += -DALLOW_EXPERIMENTAL_APIS CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) LDLIBS += -lrte_eal -lrte_mempool diff --git a/mk/internal/rte.compile-pre.mk b/mk/internal/rte.compile-pre.mk index da8dda498..83a53c202 100644 --- a/mk/internal/rte.compile-pre.mk +++ b/mk/internal/rte.compile-pre.mk @@ -84,6 +84,9 @@ C_TO_O = $(CC) -Wp,-MD,$(call obj2dep,$(@)).tmp $(CPPFLAGS) $(CFLAGS) \ C_TO_O_STR = $(subst ','\'',$(C_TO_O)) #'# fix syntax highlight C_TO_O_DISP = $(if $(V),"$(C_TO_O_STR)"," CC $(@)") endif +EXPERIMENTAL_CHECK = $(RTE_SDK)/buildtools/experimentalsyms.sh +CHECK_EXPERIMENTAL = $(EXPERIMENTAL_CHECK) $(SRCDIR)/$(EXPORT_MAP) $@ + PMDINFO_GEN = $(RTE_SDK_BIN)/app/dpdk-pmdinfogen $@ $@.pmd.c PMDINFO_CC = $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@.pmd.o $@.pmd.c PMDINFO_LD = $(CROSS)ld $(LDFLAGS) -r -o $@.o $@.pmd.o $@ @@ -100,6 +103,7 @@ C_TO_O_DO = @set -e; \ echo $(C_TO_O_DISP); \ $(C_TO_O) && \ $(PMDINFO_TO_O) && \ + $(CHECK_EXPERIMENTAL) && \ echo $(C_TO_O_CMD) > $(call obj2cmd,$(@)) && \ sed 's,'$@':,dep_'$@' =,' $(call obj2dep,$(@)).tmp > $(call obj2dep,$(@)) && \ rm -f $(call obj2dep,$(@)).tmp diff --git a/mk/toolchain/clang/rte.vars.mk b/mk/toolchain/clang/rte.vars.mk index dde922d22..3cfe92545 100644 --- a/mk/toolchain/clang/rte.vars.mk +++ b/mk/toolchain/clang/rte.vars.mk @@ -67,7 +67,7 @@ WERROR_FLAGS := -W -Wall -Wstrict-prototypes -Wmissing-prototypes WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith WERROR_FLAGS += -Wnested-externs -Wcast-qual WERROR_FLAGS += -Wformat-nonliteral -Wformat-security -WERROR_FLAGS += -Wundef -Wwrite-strings +WERROR_FLAGS += -Wundef -Wwrite-strings -Wdeprecated ifeq ($(RTE_DEVEL_BUILD),y) WERROR_FLAGS += -Werror diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk index 3b907e201..3356a37c8 100644 --- a/mk/toolchain/gcc/rte.vars.mk +++ b/mk/toolchain/gcc/rte.vars.mk @@ -75,7 +75,7 @@ WERROR_FLAGS := -W -Wall -Wstrict-prototypes -Wmissing-prototypes WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith WERROR_FLAGS += -Wcast-align -Wnested-externs -Wcast-qual WERROR_FLAGS += -Wformat-nonliteral -Wformat-security -WERROR_FLAGS += -Wundef -Wwrite-strings +WERROR_FLAGS += -Wundef -Wwrite-strings -Wdeprecated ifeq ($(RTE_DEVEL_BUILD),y) WERROR_FLAGS += -Werror diff --git a/mk/toolchain/icc/rte.vars.mk b/mk/toolchain/icc/rte.vars.mk index 33a8ba79e..58940602e 100644 --- a/mk/toolchain/icc/rte.vars.mk +++ b/mk/toolchain/icc/rte.vars.mk @@ -73,7 +73,7 @@ TOOLCHAIN_ASFLAGS = WERROR_FLAGS := -Wall -w2 -diag-disable 271 -diag-warning 1478 WERROR_FLAGS += -diag-disable 13368 -diag-disable 15527 WERROR_FLAGS += -diag-disable 188 -WERROR_FLAGS += -diag-disable 11074 -diag-disable 11076 +WERROR_FLAGS += -diag-disable 11074 -diag-disable 11076 -Wdeprecated ifeq ($(RTE_DEVEL_BUILD),y) WERROR_FLAGS += -Werror-all -- 2.14.3