From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B3A70A046B for ; Wed, 24 Jul 2019 22:28:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 854941C262; Wed, 24 Jul 2019 22:28:28 +0200 (CEST) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by dpdk.org (Postfix) with ESMTP id 5011B1C257 for ; Wed, 24 Jul 2019 22:28:25 +0200 (CEST) Received: by mail-pl1-f177.google.com with SMTP id a93so22392247pla.7 for ; Wed, 24 Jul 2019 13:28:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=g8MpBF8semt6kcRCtP6Vo4lAPv6x3WeGpB6MeTxzd1I=; b=XJ4HQSMqhVKJ5ZFQS9WKhJGNQWP7O9jZihcvarpBvq4zs8mreGpIaTKh9Ozu5UTnL7 nYOz5XGCSPxZgre6/0RliOdZ95wBgG8jfgmS2I3k4O13kBML++OEcrecJPNwAsefJGPF UaB4HHKCWR+qOhzYKykjooy31MFxWsGNtMkgyWKKGnJvpE6WQjJL9Lm07PXgXZphIpSz /0gn0HzOo86ZsXub8OnummUMGi+RQPi3YlNQ5xgpm6W69PNmvAeZ/53aKV4RoZLgwCve cAQWefFyW2W3IAP1SDrQ2zJrpJsF341L823ww2XFuvdzVVsAsNTgKGXZGw3V1PMdTPDC gfmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=g8MpBF8semt6kcRCtP6Vo4lAPv6x3WeGpB6MeTxzd1I=; b=sV+BfPe7aZP+S9CE8PAUpaotYMTpAc04R+gZOXLinYc952mx1mPTYha4gPm9n5+oDh RKFwkiJlIGzbhiv+Do6Me5z42XCK+6BsM+cSHJ+kq2OlLgidlDzJpIsw1aKLaH3d+6sC 9hE9yuExCdFNLsbOggDhogzoJgvY1o56KOrTl9JtAayUtcPr2ybVugndfaHcEScp9Gev SM2RXhfH25vLS2L742qADQK2tqEgnFwremhHXn/ToAxMf1e0eT4ZnvIs8Gtn+qgLu/gn TMR12uNKKC6wbvFqDxgPjl8Z7HOi1QlI937FqPmD79VTAwd/tlB8x9V9zb8EzJGCv/s5 YnoA== X-Gm-Message-State: APjAAAWYmH7bM6UZ2LRlpn+LGdojG9Sp1G4YVopaPFAnotw3uorCByU6 JAc4oRmkBm1d2dUas+MDfoM= X-Google-Smtp-Source: APXvYqxCQbZEILKrS89P79n0cV5f9mHhm2Ibw0wxk+mWkhN7uqNOjI6T94U7S2h1u3k04Zs2YRU3Ew== X-Received: by 2002:a17:902:12d:: with SMTP id 42mr83149517plb.187.1564000104273; Wed, 24 Jul 2019 13:28:24 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id m4sm58020378pgs.71.2019.07.24.13.28.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 13:28:23 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , stable@dpdk.org Date: Wed, 24 Jul 2019 13:28:12 -0700 Message-Id: <20190724202813.9743-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190724202813.9743-1-stephen@networkplumber.org> References: <20190724202813.9743-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH 1/2] mk: fix missing pci bus with shared library build X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" If DPDK is built as a shared library, then any application linked with rte.app.mk will not find any buses (including PCI devices). This is because the linker will not call the initializers of the bus libraries since they are not directly called by application or EAL. Bugzilla ID: 333 Fixes: c752998b5e2e ("pci: introduce library and driver") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- mk/rte.app.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mk/rte.app.mk b/mk/rte.app.mk index a277c808ed8e..3b3156bfcf09 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -123,6 +123,10 @@ ifneq (,$(findstring y,$(MVEP-y))) _LDLIBS-y += -lrte_common_mvep -L$(LIBMUSDK_PATH)/lib -lmusdk endif +# Bus devices use constructors to register and therefore +# need to be always linked in (--whole-archive already enabled) +_LDLIBS-y += --no-as-needed + ifeq ($(CONFIG_RTE_LIBRTE_DPAA_BUS),y) _LDLIBS-$(CONFIG_RTE_LIBRTE_COMMON_DPAAX) += -lrte_common_dpaax endif @@ -137,6 +141,9 @@ ifeq ($(CONFIG_RTE_EAL_VFIO),y) _LDLIBS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += -lrte_bus_fslmc endif +# drivers are as-needed +_LDLIBS-y += --as-needed + ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n) # plugins (link only if static libraries) -- 2.20.1