From patchwork Fri Jun 30 23:00:08 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: 106774 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2880802qge; Fri, 30 Jun 2017 16:02:24 -0700 (PDT) X-Received: by 10.55.20.36 with SMTP id e36mr29430739qkh.1.1498863744324; Fri, 30 Jun 2017 16:02:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498863744; cv=none; d=google.com; s=arc-20160816; b=Ycdl26PeWPQK5YCi9d8DcSFGID+GgeYejB2AKjxC+qnAkGYfhqC3j7aKSm1OiTEL63 QcI3Oac4PNlLQyHbPSx10R/i5NVnCMhfwVTqKtcn1hgXtwzdlSKneLs2Ap1lBMbplgbH FNN2+ftEn3wwam+qs8Ijg958QUzFs//Goj11KM/T3WbSDdGGwxod6l/r+Gg9MCSSmogG ScewsVkLAksVv8UkfkkhkkXEmY+4NiTf+KYoAwyUpIvyFXgNgE7+VewgNgfmoB7rZh/g Eys4lu47mfrzt1R0veavKJRjB6W6pXB0ddC+YUU6opw+bDFRlJ8V6p1zE+x9EEkaJXvk yjIQ== 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=E4AoyXN45OHs7XAF5eixOT/UAQQ9ft3cs6Dfk5/ihfU=; b=bDVhAmu2AgnwBTCftERd1uiGX76EKkjseMYTgOJySxTqLzbHDwPM0sCYHdHra8Uuag Xg32LqUJUSwT0GG3qosriKPUaIesEMZVWdGJgGW7Yrq0FJbRrH5TJeAuRIoqa2k31UJZ wKbo8inVYGnAMhKkPQL2F05iYiWOA/N/EA8qpoOVaerU0oog9zkE16cecDj4U6+Qt0C/ XPA4NtOsZVR0UE2doxBOhNA++0wjHgO6KNYj9HZE2/Hr5f527QgJUW+bQCanc0a6PM9T O2Zhrj8bWONcgZQlsS19Fwq52mEo8qlbi1X5FZLymE46hQ14/jclltrZIXepRj5fYPVr DH2Q== 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 i58si8671826qti.338.2017.06.30.16.02.24; Fri, 30 Jun 2017 16:02:24 -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 07D2362AE9; Fri, 30 Jun 2017 23:02:24 +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 1711762B5D; Fri, 30 Jun 2017 23:00:41 +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 D5C8962AEA; Fri, 30 Jun 2017 23:00:28 +0000 (UTC) Received: from forward4o.cmail.yandex.net (forward4o.cmail.yandex.net [37.9.109.248]) by lists.linaro.org (Postfix) with ESMTPS id 68BC0609FF for ; Fri, 30 Jun 2017 23:00:22 +0000 (UTC) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::28]) by forward4o.cmail.yandex.net (Yandex) with ESMTP id 9BE2220685 for ; Sat, 1 Jul 2017 02:00:20 +0300 (MSK) Received: from smtp4o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp4o.mail.yandex.net (Yandex) with ESMTP id 786576C0110F for ; Sat, 1 Jul 2017 02:00:19 +0300 (MSK) Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id jomLhvwstF-0J7WYMwX; Sat, 01 Jul 2017 02:00:19 +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: Sat, 1 Jul 2017 02:00:08 +0300 Message-Id: <1498863614-26294-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1498863614-26294-1-git-send-email-odpbot@yandex.ru> References: <1498863614-26294-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 45 Subject: [lng-odp] [PATCH v3 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: ceeab69f3af67701adb524c7b9757d19cefb1110 ** Merge commit sha: bc5ee5a9b895a630b180cd264a55c8e4817de750 **/ configure.ac | 1 - pkgconfig/libodp-linux.pc.in | 4 ++-- platform/linux-generic/Makefile.am | 2 ++ platform/linux-generic/m4/odp_dpdk.m4 | 29 +++++++++++++++------------- test/Makefile.inc | 2 +- test/common_plat/validation/api/Makefile.inc | 1 + test/linux-generic/Makefile.inc | 2 +- 7 files changed, 23 insertions(+), 18 deletions(-) diff --git a/configure.ac b/configure.ac index 45812f66..3432b29a 100644 --- a/configure.ac +++ b/configure.ac @@ -210,7 +210,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 0c5883b6..6dc06dc9 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 @ATOMIC_LIBS@ +Libs: -L${libdir} -lodp-linux @DPDK_LIBS@ +Libs.private: @OPENSSL_STATIC_LIBS@ @DPDK_PMDS@ @DPDK_LIBS@ -lpcap @PTHREAD_LIBS@ -lrt -lpthread @ATOMIC_LIBS@ Cflags: -I${includedir} diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index eb7b0422..45bee7ea 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 \ @@ -257,6 +258,7 @@ endif __LIB__libodp_linux_la_LIBADD = $(ATOMIC_LIBS) __LIB__libodp_linux_la_LIBADD += $(OPENSSL_LIBS) +__LIB__libodp_linux_la_LIBADD += $(DPDK_LIBS) $(DPDK_PMDS) # Create symlink for ABI header files. Application does not need to use the arch # specific include path for installed files. 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/Makefile.inc b/test/Makefile.inc index 1ef2a92c..bf31b374 100644 --- a/test/Makefile.inc +++ b/test/Makefile.inc @@ -4,7 +4,7 @@ LIB = $(top_builddir)/lib #in the following line, the libs using the symbols should come before #the libs containing them! The includer is given a chance to add things #before libodp by setting PRE_LDADD before the inclusion. -LDADD = $(PRE_LDADD) $(LIB)/libodphelper.la $(LIB)/libodp-linux.la +LDADD = $(PRE_LDADD) $(LIB)/libodphelper.la $(LIB)/libodp-linux.la $(DPDK_PMDS) INCFLAGS = \ -I$(top_builddir)/platform/@with_platform@/include \ 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 = \