From patchwork Wed Jan 24 02:00:08 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: 125612 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp116198ljf; Tue, 23 Jan 2018 18:01:02 -0800 (PST) X-Google-Smtp-Source: AH8x225uyi/qLY/rRstCFvvl7XJm4uUJ+S851J7zWGrlaaI7GMmJIXzekOTUVHA5Y975YQ/zOWU7 X-Received: by 10.200.64.90 with SMTP id j26mr7131471qtl.29.1516759262444; Tue, 23 Jan 2018 18:01:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516759262; cv=none; d=google.com; s=arc-20160816; b=PP2aUef3+xvnbRYrjECRRH3vGeMDpg4Tp8YHsSHwPsKTkCNCA32S9A6OthkmLd+QNe fCNCSoDpVIz4Fg1nOm6dwGbHPlAKmmu3JbZklx0k8xEx2ZIQFko9IE4xmjLElTLgu3sx BScweo826ZyjynY7gR5bcKGX1my4A0sMhIV+HgqwDS5cLc22f19+AxsNRlMSIvREAIsu BnX60OXLomKWWhTjchiQyudrBhQ/kgIs+3yngsDuv+jr3s/2nWfWwqjW/gGAnbCnP6dk kz90hg5z0999d/LLcwSgQafEhYgALq5VmcEkjMSk5YUGnZrMt+nkzb0N61f7N3i1zmY1 8KwQ== 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=Mf+YNKuUeJSwmcppgalXE060AwcvppLeGLxR46ixMZY=; b=UrjF01cnUE7BTPq/0INDKiGbPT5amWwYBRzy2fZCOSauPO9+4THqTfqziT2kaxhii6 mLcI6d6FKh+OFWJd5iqxrBec2Y6B0EmlSxYs6TN08qMspdiQSaZBkfGhMkFTwJaqmvv6 0uR+qjFDGuTSp1pvWpIpcufaOuBqjpRt+dHJppXetZQoLTvLXokjlNPeisFXC9yDMjsE gm5J+/rJp2ZN5w/ho4nalsVE1/BRVxBz8eIr6s5/ZUIdqIMwSQCTDk8YNOtUAodk/juP FA92Kgvq8o5n3pnRwSh7gtebM+U/Q2JoHVXUjyubaYwazD/dAtRHO3SAt8dvn1ZCQJGw PC/Q== 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 q30si1653490qte.351.2018.01.23.18.01.02; Tue, 23 Jan 2018 18:01: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 1E55C617F3; Wed, 24 Jan 2018 02:01:02 +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 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 5161D6175F; Wed, 24 Jan 2018 02:00:25 +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 6014161520; Wed, 24 Jan 2018 02:00:19 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id 872E660974 for ; Wed, 24 Jan 2018 02:00:17 +0000 (UTC) Received: from mxback2o.mail.yandex.net (mxback2o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1c]) by forward103p.mail.yandex.net (Yandex) with ESMTP id 3D2372182BFD for ; Wed, 24 Jan 2018 05:00:16 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback2o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id DsSQFQ2MH3-0GtO8NSb; Wed, 24 Jan 2018 05:00:16 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Eede1EXMx1-0FN8w0IO; Wed, 24 Jan 2018 05:00:15 +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: Wed, 24 Jan 2018 05:00:08 +0300 Message-Id: <1516759212-29210-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516759212-29210-1-git-send-email-odpbot@yandex.ru> References: <1516759212-29210-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 416 Subject: [lng-odp] [PATCH v3 1/5] build: odp_dpdk: another fix for 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 Older toolchains won't include all shared objects from the group so file to DT_NEEDED section. So use --as-needed/--no-as-needed flags to control linking with DPDK PMD libs. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 416 (lumag:trav-dpdk-shared) ** https://github.com/Linaro/odp/pull/416 ** Patch: https://github.com/Linaro/odp/pull/416.patch ** Base sha: b122176ee59494dd957f0f5ff41d4b55a1477e13 ** Merge commit sha: eda6bc11b0fade6a40b217608359775c2c7043f8 **/ m4/odp_dpdk.m4 | 21 +++++++++++++++------ platform/linux-generic/Makefile.am | 2 +- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/m4/odp_dpdk.m4 b/m4/odp_dpdk.m4 index 1887b0431..81ace08a9 100644 --- a/m4/odp_dpdk.m4 +++ b/m4/odp_dpdk.m4 @@ -17,18 +17,29 @@ AS_VAR_APPEND([DPDK_PMDS], [--no-whole-archive]) # _ODP_DPDK_SET_LIBS # -------------------- -# Set DPDK_LIBS/DPDK_LIBS_LT depending on DPDK setup +# Set DPDK_LIBS/DPDK_LIBS_LT/DPDK_LIBS_LIBODP depending on DPDK setup AC_DEFUN([_ODP_DPDK_SET_LIBS], [dnl AS_IF([test "x$DPDK_SHARED" = "xyes"], [dnl - DPDK_LIBS_LT="" + # applications don't need to be linked to anything, just rpath + DPDK_LIBS_LT="$DPDK_RPATH_LT" + # static linking flags will need -ldpdk + DPDK_LIBS="-Wl,--no-as-needed,-ldpdk,--as-needed,`echo $DPDK_LIBS | sed -e 's/ /,/g'`" DPDK_LIBS="$DPDK_LDFLAGS $DPDK_RPATH $DPDK_LIBS" + # link libodp-linux with -ldpdk + DPDK_LIBS_LIBODP="$DPDK_LIBS" ], [dnl ODP_DPDK_PMDS([$DPDK_PMD_PATH]) + # build long list of libraries for applications, which should not be + # rearranged by libtool DPDK_LIBS_LT="`echo $DPDK_LIBS | sed -e 's/^/-Wc,/' -e 's/ /,/g'`" DPDK_LIBS_LT="$DPDK_LDFLAGS $DPDK_PMDS $DPDK_LIBS_LT $DPDK_LIBS" + # static linking flags follow the suite DPDK_LIBS="$DPDK_LDFLAGS $DPDK_PMDS $DPDK_LIBS" + # link libodp-linux with libtool linking flags + DPDK_LIBS_LIBODP="$DPDK_LIBS_LT" ]) AC_SUBST([DPDK_LIBS]) +AC_SUBST([DPDK_LIBS_LIBODP]) AC_SUBST([DPDK_LIBS_LT]) ]) @@ -99,7 +110,6 @@ AC_DEFUN([ODP_DPDK], [dnl AS_IF([test "x$1" = "xsystem"], [dnl 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`" @@ -115,10 +125,9 @@ AS_IF([test "x$1" = "xsystem"], [dnl DPDK_LDFLAGS="-L$DPDK_LIB_PATH" DPDK_PMD_PATH="$DPDK_LIB_PATH" if test -r "$DPDK_LIB_PATH"/libdpdk.so ; then - DPDK_RPATH="-R$DPDK_LIB_PATH" + DPDK_RPATH="-Wl,-rpath,$DPDK_LIB_PATH" + DPDK_RPATH_LT="-R$DPDK_LIB_PATH" DPDK_SHARED=yes - else - DPDK_RPATH= fi ]) _ODP_DPDK_CHECK([$DPDK_CPPFLAGS], [$DPDK_LDFLAGS], [$2], [$3]) diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 8585080df..3e38489f6 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -272,7 +272,7 @@ endif __LIB__libodp_linux_la_LIBADD = $(ATOMIC_LIBS) __LIB__libodp_linux_la_LIBADD += $(OPENSSL_LIBS) -__LIB__libodp_linux_la_LIBADD += $(DPDK_LIBS_LT) +__LIB__libodp_linux_la_LIBADD += $(DPDK_LIBS_LIBODP) __LIB__libodp_linux_la_LIBADD += $(PTHREAD_LIBS) __LIB__libodp_linux_la_LIBADD += $(TIMER_LIBS)