From patchwork Mon Jan 1 22:00:02 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: 123085 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8279079qgn; Mon, 1 Jan 2018 14:07:00 -0800 (PST) X-Google-Smtp-Source: ACJfBovo1qsMtO53H8Uh4ERfTYgCj8XEKFvrspJT+A9o5w96QAy4LzJL0XmYbDCYJ947EhXV8wIp X-Received: by 10.200.57.80 with SMTP id t16mr58254885qtb.98.1514844419923; Mon, 01 Jan 2018 14:06:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514844419; cv=none; d=google.com; s=arc-20160816; b=UdXnIcB07GaSqAq7++EvdizKt2VRR+w+JVr53pU5ZoN4veN1CRKHu2S/o9OSA6Poq2 xFioHOX+o8AHBLw/MJ8kYC6Cb7y52TBznoir3LTWEqIX+UzsNReTGs+b0e7LrD2VKCVv azjJyywBveKAHE/DTWBxECOOfHN24UW0i07mxkYAvAYOqKx31fCf0ZhGTpfROssrJZlC AqEtg68qJRO1eDLyqiu46tfYl1WqsQDGZVRIJ5Pdt6bS1rsZDG+JNHdT9XtU4j0OXzz9 /XmJ1IMOmMHDl6NGTqdawqcR59ulyhUSLJY1/ECzKTHgpYQGuoV7aMg9uxBoUAA3qYrM yTvw== 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=aX8woargNs7BJpbBTrohLgn0iawjMPjLda1aJ7LJcDU=; b=JqnNKwOvlxmT0oZ1ZindavaQiap+rxrDXpJEzwPYBIzWVzJuEn54L041R55xpov1qN fC8YkRdaVgnoFfQI6kR9FECu8yPEzX/r3KCG2R8GPRAYpefnf4beWLTZRBSsj0QHHq0W zEOEuRcYK/BYCuEOu1SLzrepdJ1+FzRwKU95SWIXChN+rWWsyHzPeMKxaXS5pfWM6QV6 HxWh7Ze7fzYkR7jBB7HsAOL+42EM5cGSnWDdoVnQoCnw/YXn0zdHFwhRJAqF5AIi2Z7k j9j2NhiOhCj3u0ngWOJyIRJdFcnOldGR6XdutnXQoPmcoSIcA1rAiL67wKDRyLoqiSwf m+uA== 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 r28si2114150qkr.68.2018.01.01.14.06.59; Mon, 01 Jan 2018 14:06:59 -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 9C32A6151A; Mon, 1 Jan 2018 22:06:59 +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_H2, 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 7A48F608F8; Mon, 1 Jan 2018 22:01:06 +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 E485B60848; Mon, 1 Jan 2018 22:00:19 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id 68C426084A for ; Mon, 1 Jan 2018 22:00:13 +0000 (UTC) Received: from mxback1g.mail.yandex.net (mxback1g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:162]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 2FBC95102615 for ; Tue, 2 Jan 2018 01:00:12 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback1g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id JYfGfgRSRP-0CMGmPb1; Tue, 02 Jan 2018 01:00:12 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id X57ZRXUA30-0BPmnp0M; Tue, 02 Jan 2018 01:00:11 +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 01:00:02 +0300 Message-Id: <1514844007-22122-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514844007-22122-1-git-send-email-odpbot@yandex.ru> References: <1514844007-22122-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 377 Subject: [lng-odp] [PATCH v5 6/11] 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: 3b7e2ac62accecc65b9f91635a4b6ef04ca77988 **/ 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])