From patchwork Sun Dec 31 10:00:05 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: 123015 Delivered-To: patch@linaro.org Received: by 10.80.135.92 with SMTP id 28csp2220859edv; Sun, 31 Dec 2017 02:05:45 -0800 (PST) X-Google-Smtp-Source: ACJfBoslHFnZtDPRPipn3JgpxQRmw8mmdYqqmdY/Dt4AMV7jmANjjIUDQ8qZkisJBgKbEcfutYh5 X-Received: by 10.200.26.13 with SMTP id v13mr43584420qtj.107.1514714745616; Sun, 31 Dec 2017 02:05:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514714745; cv=none; d=google.com; s=arc-20160816; b=SyeJmoDbIBEdV+3IIMpjmW/7KLcTDUpqwuQdmbONdsCvAVlW4JyVjJPcsyTm88JEuJ T0GjTGwYcAJBPrBpAPpfAa2uqG/Tv1p+8rfXhaA13BaErEauMpH3sjBb/RLbGGXbCjzY fqtw/Nkfhtb7cTSNTkLSvmnJSrL+xt/Vk6dyChEfhKrJbhsq5QKmh/CWjAgCUyEfTHhm x92lXBo3tGVPK2y4LFc0nEoY3QdxcfOH87UROC3+jMJtlG36qX3dUymVvQ/bVOJYpQsL u14eX4vEwXtXZC013nbd2GgLI8gR0zOvLnTgKDSmxfjRRxRNMi2uIbs9YYfdYwcGEdfC QUgQ== 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=IiiwvQJMQOr0IoBrkniyThH/M1WmgnyzTTQld/VBe4c=; b=LKYvfea6+erjS9bPOUaJFXYwvXawX8iRWnINsqCKegZbxkEEE5ebzChTBRTq+uFKyK qPgebPxHGK+/k5blxT0IzR57jP86aQDQjFdzNFw8IpUF0Us6+OEgrmddo6qSTVWRMMFZ XmCPeXSbwM2QhU1W7W4+pSSJvxXULvaCWHzW5CpF3lluesDsSy67Cpn3p38oUB5D9bZZ E4Y0LOnftb5/dsiKGpOCybpGvLCUQju2+wP7O0TKpf8DggOp8jZIRmR9NzosjJBUSr7U LVzfKeNakgTpYqd9pXMyzkWnJD7P7YOEgFhR7oDhRpUPA/MYL8zwnAR/9VxuTCS+/kDM Y8bw== 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 k42si24461985qtf.429.2017.12.31.02.05.45; Sun, 31 Dec 2017 02:05:45 -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 22A8D616F7; Sun, 31 Dec 2017 10:05:45 +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 11A9D616E8; Sun, 31 Dec 2017 10:00:50 +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 7BC016151B; Sun, 31 Dec 2017 10:00:20 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id 8196660B41 for ; Sun, 31 Dec 2017 10:00:13 +0000 (UTC) Received: from mxback3g.mail.yandex.net (mxback3g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:164]) by forward105j.mail.yandex.net (Yandex) with ESMTP id 62159180EAB for ; Sun, 31 Dec 2017 13:00:12 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback3g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id kmrcAT85MJ-0CbqIiOD; Sun, 31 Dec 2017 13:00:12 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id fDOtarRzt4-0BLeUKB4; Sun, 31 Dec 2017 13: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: Sun, 31 Dec 2017 13:00:05 +0300 Message-Id: <1514714407-7846-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514714407-7846-1-git-send-email-odpbot@yandex.ru> References: <1514714407-7846-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 377 Subject: [lng-odp] [PATCH v2 6/8] 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: 220e6aded9453e606a66be584a78d7d08718be8d **/ 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..0d30226ac 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])