From patchwork Fri Jun 2 14:00:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 101271 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp414167qge; Fri, 2 Jun 2017 07:06:36 -0700 (PDT) X-Received: by 10.200.35.230 with SMTP id r35mr8818884qtr.167.1496412396153; Fri, 02 Jun 2017 07:06:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496412396; cv=none; d=google.com; s=arc-20160816; b=h24QBAGbm+c3lDAc1KsGgIMeN9lHFDYPqJDP2owILS5dca3hGbH4dxX7bZQeoih3LO zURn3PR+VXZu+N/ZTmws8vVvicNK8BY+osRJZhISHvxhJzvXGw22/zOy16ekwKImpySM z8NF2uWT+uZnqfURxUcols9NvgBPzNMD6aJoMo16J4wdH4L5jCCunNHI8/x32vkMGvyn s4QfvUUEpxw7Zw18S0Lo4igicRbsE54bbt0mVKjFinrmzIu4v5UC5z22TSDiy0TGAgJG SXx/uJh7uBNj9gFyI1bV6LWAot9Io1BZYaHX4ci9icSSqRckJ46BERslHcZPJaplXSKv W31Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=4Npa1R/KcGuAMgA7NbUd+/Npci520s/HcVZGJb/N+7w=; b=KTVkUm3yKogaSLjYyJT0Tp8CRWlQyUoLyX1l0u1G9DF0EL/MfJ1yIvoUnWzho5kU3D 2qOR07yneHh4Ozh5Sejet/COmoO+4wMQ53gIs2uAD0XRokKO+F9sEMJau5laTTwI3rTH yqvBw6sl9OEg4/QXAHIsSCM1v7SKILEp1CyyM5JdvXVqpdP0pbd0yeMlE3czBgIfxJVV ziQhASkb4NCZ1NOygyjzztJIDlYSO9WsaiEvQOjr1811UaFMJzY9mZg61G8/dRWDcY6y JRDc1/GE4jN8wxFpqSi0gLbDb/PVPkaPgi65U1AyYubuXX79MZtdrGFvpI5FDyHBNFMn V5Xg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id b18si1898809qte.118.2017.06.02.07.06.35; Fri, 02 Jun 2017 07:06:36 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id CCD0F6068E; Fri, 2 Jun 2017 14:06:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, URIBL_BLOCKED, URIBL_SBL, URIBL_SBL_A autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 5C1C260EE7; Fri, 2 Jun 2017 14:01:40 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 793D66067C; Fri, 2 Jun 2017 14:01:07 +0000 (UTC) Received: from forward4p.cmail.yandex.net (forward4p.cmail.yandex.net [77.88.31.19]) by lists.linaro.org (Postfix) with ESMTPS id 65D7F60E39 for ; Fri, 2 Jun 2017 14:00:18 +0000 (UTC) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::26]) by forward4p.cmail.yandex.net (Yandex) with ESMTP id 5441220684 for ; Fri, 2 Jun 2017 17:00:17 +0300 (MSK) Received: from smtp2o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2o.mail.yandex.net (Yandex) with ESMTP id 77D0B5081194 for ; Fri, 2 Jun 2017 17:00:13 +0300 (MSK) Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id cZMbbMEits-0DoiKMOJ; Fri, 02 Jun 2017 17:00:13 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Suid-Status: 1 0 From: Github ODP bot To: lng-odp@lists.linaro.org Date: Fri, 2 Jun 2017 17:00:01 +0300 Message-Id: <1496412007-23455-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1496412007-23455-1-git-send-email-odpbot@yandex.ru> References: <1496412007-23455-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 45 Subject: [lng-odp] [PATCH v1 3/9] linux-gen: stop poisoning CPPFLAGS/LDFLAGS with DPDK flags X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Instead of poisoning global AM_CPPFLAGS/AM_LDFLAGS with DPDK flags, use fine-grained controls for compiling/linking with DPDK. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 45 (lumag:m4) ** https://github.com/Linaro/odp/pull/45 ** Patch: https://github.com/Linaro/odp/pull/45.patch ** Base sha: e6be64e01589f1aa335ea178e8314bf35ad34847 ** Merge commit sha: 6f335855aeda94f83296fb7e0d08b293ea4121db **/ configure.ac | 1 - pkgconfig/libodp-linux.pc.in | 4 ++-- platform/linux-generic/Makefile.am | 2 ++ platform/linux-generic/m4/odp_dpdk.m4 | 29 +++++++++++++++------------- test/common_plat/validation/api/Makefile.inc | 1 + test/linux-generic/Makefile.inc | 2 +- 6 files changed, 22 insertions(+), 17 deletions(-) diff --git a/configure.ac b/configure.ac index 7569ebe0..437a978e 100644 --- a/configure.ac +++ b/configure.ac @@ -209,7 +209,6 @@ AC_SUBST([testdir]) # Set conditionals as computed within platform specific files ########################################################################## AM_CONDITIONAL([netmap_support], [test x$netmap_support = xyes ]) -AM_CONDITIONAL([PKTIO_DPDK], [test x$pktio_dpdk_support = xyes ]) AM_CONDITIONAL([HAVE_PCAP], [test $have_pcap = yes]) AM_CONDITIONAL([SDK_INSTALL_PATH_], [test "x${SDK_INSTALL_PATH_}" = "x1"]) AM_CONDITIONAL([test_installdir], [test "$testdir" != ""]) diff --git a/pkgconfig/libodp-linux.pc.in b/pkgconfig/libodp-linux.pc.in index ba36bafa..5b6e9c28 100644 --- a/pkgconfig/libodp-linux.pc.in +++ b/pkgconfig/libodp-linux.pc.in @@ -6,6 +6,6 @@ includedir=@includedir@ Name: libodp-linux Description: The ODP packet processing engine Version: @PKGCONFIG_VERSION@ -Libs: -L${libdir} -lodp-linux -Libs.private: @OPENSSL_STATIC_LIBS@ -lpcap @PTHREAD_LIBS@ -lrt -lpthread +Libs: -L${libdir} -lodp-linux @DPDK_LIBS@ +Libs.private: @OPENSSL_STATIC_LIBS@ @DPDK_PMDS@ @DPDK_LIBS@ -lpcap @PTHREAD_LIBS@ -lrt -lpthread Cflags: -I${includedir} diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 0eb31c04..7f2e341d 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -12,6 +12,7 @@ AM_CFLAGS += -Iinclude AM_CFLAGS += -D_ODP_PKTIO_IPC AM_CPPFLAGS += $(OPENSSL_CPPFLAGS) +AM_CPPFLAGS += $(DPDK_CPPFLAGS) include_HEADERS = \ $(top_srcdir)/include/odp.h \ @@ -222,6 +223,7 @@ __LIB__libodp_linux_la_SOURCES = \ arch/@ARCH_DIR@/odp_sysinfo_parse.c __LIB__libodp_linux_la_LIBADD = $(OPENSSL_LIBS) +__LIB__libodp_linux_la_LIBADD += $(DPDK_LIBS) $(DPDK_PMDS) if HAVE_PCAP __LIB__libodp_linux_la_SOURCES += pktio/pcap.c diff --git a/platform/linux-generic/m4/odp_dpdk.m4 b/platform/linux-generic/m4/odp_dpdk.m4 index 58d14727..1995e0fe 100644 --- a/platform/linux-generic/m4/odp_dpdk.m4 +++ b/platform/linux-generic/m4/odp_dpdk.m4 @@ -4,15 +4,15 @@ pktio_dpdk_support=no AC_ARG_WITH([dpdk-path], AC_HELP_STRING([--with-dpdk-path=DIR path to dpdk build directory]), - [DPDK_PATH=$withval - AM_CPPFLAGS="$AM_CPPFLAGS -msse4.2 -isystem $DPDK_PATH/include" + [DPDK_PATH="$withval" + DPDK_CPPFLAGS="-msse4.2 -isystem $DPDK_PATH/include" pktio_dpdk_support=yes],[]) ########################################################################## # Save and set temporary compilation flags ########################################################################## -OLD_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$AM_CPPFLAGS $CPPFLAGS" +OLD_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$DPDK_CPPFLAGS $CPPFLAGS" ########################################################################## # Check for DPDK availability @@ -25,22 +25,23 @@ then AC_CHECK_HEADERS([rte_config.h], [], [AC_MSG_FAILURE(["can't find DPDK header"])]) - DPDK_PMD=--whole-archive, - for filename in $with_dpdk_path/lib/*.a; do - cur_driver=`echo $(basename "$filename" .a) | \ - sed -n 's/^\(librte_pmd_\)/-lrte_pmd_/p' | sed -n 's/$/,/p'` + AS_VAR_SET([DPDK_PMDS], [-Wl,--whole-archive,]) + for filename in "$DPDK_PATH"/lib/librte_pmd_*.a; do + cur_driver=`basename "$filename" .a | sed -e 's/^lib//'` # rte_pmd_nfp has external dependencies which break linking - if test "$cur_driver" = "-lrte_pmd_nfp,"; then + if test "$cur_driver" = "rte_pmd_nfp"; then echo "skip linking rte_pmd_nfp" else - DPDK_PMD+=$cur_driver + AS_VAR_APPEND([DPDK_PMDS], [-l$cur_driver,]) fi done - DPDK_PMD+=--no-whole-archive + AS_VAR_APPEND([DPDK_PMDS], [--no-whole-archive]) ODP_CFLAGS="$ODP_CFLAGS -DODP_PKTIO_DPDK" - AM_LDFLAGS="$AM_LDFLAGS -L$DPDK_PATH/lib -Wl,$DPDK_PMD" - LIBS="$LIBS -ldpdk -ldl -lpcap" + DPDK_LIBS="-L$DPDK_PATH/lib -ldpdk -lpthread -ldl -lpcap" + AC_SUBST([DPDK_CPPFLAGS]) + AC_SUBST([DPDK_LIBS]) + AC_SUBST([DPDK_PMDS]) else pktio_dpdk_support=no fi @@ -49,3 +50,5 @@ fi # Restore old saved variables ########################################################################## CPPFLAGS=$OLD_CPPFLAGS + +AM_CONDITIONAL([PKTIO_DPDK], [test x$pktio_dpdk_support = xyes ]) diff --git a/test/common_plat/validation/api/Makefile.inc b/test/common_plat/validation/api/Makefile.inc index dda18adc..6069ee6b 100644 --- a/test/common_plat/validation/api/Makefile.inc +++ b/test/common_plat/validation/api/Makefile.inc @@ -9,6 +9,7 @@ AUTOMAKE_OPTIONS = nostdinc AM_CFLAGS += -I$(top_srcdir)/test/common_plat/common AM_LDFLAGS += -static +AM_LDFLAGS += $(DPDK_PMDS) LIBCUNIT_COMMON = $(COMMON_DIR)/libcunit_common.la LIBCPUMASK_COMMON = $(COMMON_DIR)/libcpumask_common.la diff --git a/test/linux-generic/Makefile.inc b/test/linux-generic/Makefile.inc index 198087f3..6e165d8d 100644 --- a/test/linux-generic/Makefile.inc +++ b/test/linux-generic/Makefile.inc @@ -6,7 +6,7 @@ AM_LDFLAGS += -static LIBCUNIT_COMMON = $(top_builddir)/test/common_plat/common/libcunit_common.la LIB = $(top_builddir)/lib -LIBODP = $(LIB)/libodphelper.la $(LIB)/libodp-linux.la +LIBODP = $(LIB)/libodphelper.la $(LIB)/libodp-linux.la $(DPDK_PMDS) INCCUNIT_COMMON = -I$(top_srcdir)/test/common_plat/common INCODP = \