From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 66A70A00C2; Sat, 25 Apr 2020 08:11:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 48BB51C1D4; Sat, 25 Apr 2020 08:10:41 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 23DBA1C197 for ; Sat, 25 Apr 2020 08:10:38 +0200 (CEST) IronPort-SDR: HjsB5WjK3G90yoQE2za4drR/3QeTwD6O2xiOGztIsb/sQFYT43E6LuEifDtpMDc2qChQeyEDHO 1Nt9FWGA84ww== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2020 23:10:38 -0700 IronPort-SDR: G6GKNvdSVFKYlZR+FkgCSW6H7bk+rszZlCcaTloWC5W4+drD8HVUIIqBnlbWokOENy15SIG9fT F3Nki00ct2Ig== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,314,1583222400"; d="scan'208";a="281099193" Received: from npg-dpdk-haiyue-3.sh.intel.com ([10.67.119.46]) by fmsmga004.fm.intel.com with ESMTP; 24 Apr 2020 23:10:36 -0700 From: Haiyue Wang To: dev@dpdk.org, thomas@monjalon.net, david.marchand@redhat.com, bruce.richardson@intel.com, ferruh.yigit@intel.com, nhorman@tuxdriver.com, mdr@ashroe.eu Cc: Haiyue Wang Date: Sat, 25 Apr 2020 14:04:38 +0800 Message-Id: <20200425060441.36874-4-haiyue.wang@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200425060441.36874-1-haiyue.wang@intel.com> References: <20190613142344.9188-1-nhorman@tuxdriver.com> <20200425060441.36874-1-haiyue.wang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v6 3/6] mk: add internal tag check 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add checks during build to ensure that all symbols in the INTERNAL version map section have __internal tags on their definitions, and enable the warnings needed to announce their use. Signed-off-by: Haiyue Wang --- ...-experimental-syms.sh => check-symbols.sh} | 31 +++++++++++++++++++ mk/internal/rte.compile-pre.mk | 6 ++-- 2 files changed, 34 insertions(+), 3 deletions(-) rename buildtools/{check-experimental-syms.sh => check-symbols.sh} (61%) diff --git a/buildtools/check-experimental-syms.sh b/buildtools/check-symbols.sh similarity index 61% rename from buildtools/check-experimental-syms.sh rename to buildtools/check-symbols.sh index f3603e5ba..3df57c322 100755 --- a/buildtools/check-experimental-syms.sh +++ b/buildtools/check-symbols.sh @@ -54,4 +54,35 @@ do } done +for SYM in `$LIST_SYMBOL -S INTERNAL $MAPFILE |cut -d ' ' -f 3` +do + if grep -q "\.text.*[[:space:]]$SYM$" $DUMPFILE && + ! grep -q "\.text\.internal.*[[:space:]]$SYM$" $DUMPFILE + then + cat >&2 <<- END_OF_MESSAGE + $SYM is not flagged as internal + but is listed in version map + Please add __rte_internal to the definition of $SYM + END_OF_MESSAGE + ret=1 + fi +done + +# Filter out symbols suffixed with a . for icc +for SYM in `awk '{ + if ($2 != "l" && $4 == ".text.internal" && !($NF ~ /\.$/)) { + print $NF + } +}' $DUMPFILE` +do + $LIST_SYMBOL -S INTERNAL -s $SYM -q $MAPFILE || { + cat >&2 <<- END_OF_MESSAGE + $SYM is flagged as internal + but is not listed in version map + Please add $SYM to the version map + END_OF_MESSAGE + ret=1 + } +done + exit $ret diff --git a/mk/internal/rte.compile-pre.mk b/mk/internal/rte.compile-pre.mk index 82fe098f7..df05b5576 100644 --- a/mk/internal/rte.compile-pre.mk +++ b/mk/internal/rte.compile-pre.mk @@ -56,8 +56,8 @@ 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/check-experimental-syms.sh -CHECK_EXPERIMENTAL = $(EXPERIMENTAL_CHECK) $(SRCDIR)/$(EXPORT_MAP) $@ +CHECK_SYMBOLS_SCRIPT = $(RTE_SDK)/buildtools/check-symbols.sh +CHECK_SYMBOLS = $(CHECK_SYMBOLS_SCRIPT) $(SRCDIR)/$(EXPORT_MAP) $@ PMDINFO_GEN = $(RTE_SDK_BIN)/app/dpdk-pmdinfogen $@ $@.pmd.c PMDINFO_CC = $(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@.pmd.o $@.pmd.c @@ -75,7 +75,7 @@ C_TO_O_DO = @set -e; \ echo $(C_TO_O_DISP); \ $(C_TO_O) && \ $(PMDINFO_TO_O) && \ - $(CHECK_EXPERIMENTAL) && \ + $(CHECK_SYMBOLS) && \ echo $(C_TO_O_CMD) > $(call obj2cmd,$(@)) && \ sed 's,'$@':,dep_'$@' =,' $(call obj2dep,$(@)).tmp > $(call obj2dep,$(@)) && \ rm -f $(call obj2dep,$(@)).tmp -- 2.26.2