From patchwork Mon Jan 1 21:00:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 123072 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8235864qgn; Mon, 1 Jan 2018 13:05:02 -0800 (PST) X-Google-Smtp-Source: ACJfBosGwbmBOcFgreyC9ru+AAWtSfOwZKhSjLiWzU5YgMvDiIXum7ZM6bBYcRDInA0oWvdTdaty X-Received: by 10.200.34.177 with SMTP id f46mr57850149qta.82.1514840702100; Mon, 01 Jan 2018 13:05:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514840702; cv=none; d=google.com; s=arc-20160816; b=K/UG7WJHFvNxlUnUEUEE0TBMDPgMNagbX3buZaJw2EtCLrype3rOsbZ4ZmTIjWttHM m52zd5ouePJM7hZgmMAt01tC5cQ43GcpFSbsQXjbh1FaIRmcRDbTHqhNxCD4zXIOJk9K 6Bt83OdHrhR8OTIUIx1p35eeilatCdVdhKajQ5fTMJMwvpPiRrL0RGDZhpGSWhdrJ94l xK3WhlNCXJcqkoKGD3zA9/5pZ3Eoj7DEmVGr+//q6hgEpNg0NDTooW45hIChCi1lRXFL saTsGt6dtJc15qjYc2nTKRLw/ClZIoorKsAmYSYZtqBbP/2OVgVTYyU5Pi56+ZMVkQYH QoZQ== 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=L7niTu6GKcRWuuJ372tJm687zDy8QLk527md+hfOWaE=; b=hm7uzMn/pBgvmam/Y2vG35s8BLaNHJdiLQaLXsH0sbDWSaj3W5+NjnwLKGO26STiiw owLx9+/tnS4+ZYM4OwBZxwPhQJjcIXgZHflpIMmqkraJqrCdwckgzOL2XRUptBrCClTy 7tlKaCHO4PJJ46y9xGEB5bYzPGKGkSSAx498tDv5+yT7ipzuTPb1FIj2emC5WX5SLxy7 QDedE4TaChQdl29OTD47j1p2jNICGTe4zH9INWrLkigbxGhfYs7oRU7PffE79v1JyVNP 5boNDk+XIIpwoTEoA2zHy4vvbsiNcR1+12PFzGrAP2f0OPbIZVNMzHZDIk10OAsewj6J WzIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 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 (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id y2si1264851qta.362.2018.01.01.13.05.01; Mon, 01 Jan 2018 13:05:02 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 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 B578261524; Mon, 1 Jan 2018 21:05:01 +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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED 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 B795E6151C; Mon, 1 Jan 2018 21:02:26 +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 168576089D; Mon, 1 Jan 2018 21:02:04 +0000 (UTC) Received: from forward101j.mail.yandex.net (forward101j.mail.yandex.net [5.45.198.241]) by lists.linaro.org (Postfix) with ESMTPS id C96C3608B3 for ; Mon, 1 Jan 2018 21:00:32 +0000 (UTC) Received: from mxback4j.mail.yandex.net (mxback4j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10d]) by forward101j.mail.yandex.net (Yandex) with ESMTP id 611611241ABE for ; Tue, 2 Jan 2018 00:00:31 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback4j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id My2UyAyrcE-0VHiSkW0; Tue, 02 Jan 2018 00:00:31 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ghbdliNn2f-0Ulqwc6u; Tue, 02 Jan 2018 00:00:30 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 2 Jan 2018 00:00:09 +0300 Message-Id: <1514840413-19172-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514840413-19172-1-git-send-email-odpbot@yandex.ru> References: <1514840413-19172-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 377 Subject: [lng-odp] [PATCH v4 6/10] linux-gen: dpdk: simplify linking with shared libdpdk 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 There is no need to pass PMDs when linking with shared DPDK library. Just pass -ldpdk which will pick up all PMDS dynamically. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 377 (lumag:misc-fixes) ** https://github.com/Linaro/odp/pull/377 ** Patch: https://github.com/Linaro/odp/pull/377.patch ** Base sha: 49ebafae0edebbc750742d8874ad0a7588286dea ** Merge commit sha: ae464215ddb52c0e7bd194cbd17dcd045e5f3daf **/ m4/odp_dpdk.m4 | 3 +++ platform/linux-generic/Makefile.am | 2 +- platform/linux-generic/m4/odp_dpdk.m4 | 37 ++++++++++++++++++++++++----------- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/m4/odp_dpdk.m4 b/m4/odp_dpdk.m4 index 05e60cc06..6ea196b7a 100644 --- a/m4/odp_dpdk.m4 +++ b/m4/odp_dpdk.m4 @@ -13,6 +13,9 @@ else fi done AS_VAR_APPEND([DPDK_PMDS], [--no-whole-archive]) +# Hack to circumvent libtool to pass -ldpdk after all PMDS to gcc +# Otherwise it reorders linking flags and ends up with -ldpdk before all PMDs +AS_VAR_APPEND([DPDK_PMDS], [" "-Wc,-ldpdk]) AC_SUBST([DPDK_PMDS]) ]) diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 7e40448bd..1136d3692 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -306,7 +306,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) +__LIB__libodp_linux_la_LIBADD += $(DPDK_PMDS) $(DPDK_LIBS) __LIB__libodp_linux_la_LIBADD += $(PTHREAD_LIBS) __LIB__libodp_linux_la_LIBADD += $(TIMER_LIBS) diff --git a/platform/linux-generic/m4/odp_dpdk.m4 b/platform/linux-generic/m4/odp_dpdk.m4 index 471bbcd51..2b31c58ab 100644 --- a/platform/linux-generic/m4/odp_dpdk.m4 +++ b/platform/linux-generic/m4/odp_dpdk.m4 @@ -13,16 +13,29 @@ AC_ARG_WITH([dpdk-path], [DPDK_PATH="$withval" pktio_dpdk_support=yes],[]) -AS_IF([test "x$DPDK_PATH" = "xsystem"], - [DPDK_CPPFLAGS="-isystem/usr/include/dpdk" - DPDK_LDFLAGS="" - DPDK_PMD_PATH="`$CC --print-file-name=librte_pmd_null.a`" - DPDK_PMD_PATH="`dirname "$DPDK_PMD_PATH"`" - AS_IF([test "x$DPDK_PMD_PATH" = "x"], - [AC_MSG_FAILURE([Could not locate system DPDK PMD directory])])], - [DPDK_CPPFLAGS="-isystem $DPDK_PATH/include" - DPDK_LDFLAGS="-L$DPDK_PATH/lib" - DPDK_PMD_PATH="$DPDK_PATH/lib"]) +if test "x$DPDK_PATH" = "xsystem"; then + DPDK_CPPFLAGS="-isystem/usr/include/dpdk" + DPDK_LDFLAGS="" + DPDK_RPATH="" + DPDK_LIB_PATH="`$CC --print-file-name=libdpdk.so`" + if test "x$DPDK_LIB_PATH" = "x" ; then + DPDK_LIB_PATH="`$CC --print-file-name=libdpdk.a`" + else + DPDK_SHARED=yes + fi + AS_IF([test "x$DPDK_LIB_PATH" = "x"], + [AC_MSG_FAILURE([Could not locate system DPDK library directory])]) + DPDK_PMD_PATH=`AS_DIRNAME(["$DPDK_PMD_PATH"])` +else + DPDK_CPPFLAGS="-isystem $DPDK_PATH/include" + DPDK_LIB_PATH="$DPDK_PATH/lib" + DPDK_LDFLAGS="-L$DPDK_LIB_PATH" + DPDK_RPATH="-R$DPDK_LIB_PATH" + DPDK_PMD_PATH="$DPDK_LIB_PATH" + if test -r "$DPDK_LIB_PATH"/libdpdk.so ; then + DPDK_SHARED=yes + fi +fi ########################################################################## # Enable zero-copy DPDK pktio @@ -45,7 +58,9 @@ then ODP_DPDK_CHECK([$DPDK_CPPFLAGS], [$DPDK_LDFLAGS], [], [AC_MSG_FAILURE([can't find DPDK])]) - ODP_DPDK_PMDS([$DPDK_PMD_PATH]) + if test x$DPDK_SHARED != xyes ; then + ODP_DPDK_PMDS([$DPDK_PMD_PATH]) + fi AC_DEFINE([ODP_PKTIO_DPDK], [1], [Define to 1 to enable DPDK packet I/O support])