From patchwork Wed Jul 24 20:28:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 57049 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ADF4B1C269; Wed, 24 Jul 2019 22:28:29 +0200 (CEST) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by dpdk.org (Postfix) with ESMTP id 986931C25A for ; Wed, 24 Jul 2019 22:28:25 +0200 (CEST) Received: by mail-pl1-f179.google.com with SMTP id y8so22438195plr.12 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=AAR8g+HilaT7MytTTl/y7HakeHhz8bMzqZ6jTjaB/uuIG8pwWC3SZuD7xSvcZwzQvS z2PE5834Q1acQbOPne7Z+UDIDI2Jl6l7Mh6shfKwqAeX1ZQSRljxLeNcbDNWjuC6xQLG O/p3yJl76lUt6pIKv9rrnB/IXQxQRfXlUdfOP1gdTcsXBjrPiy0cFVhgSZJR3VYXPEvo riyiXyd6YW/ElRpE3kIfU1ver6YQ5l4SiLsKNdsvHoxoF8IbOQadAVXnXDylUYBsIvCU rXxJCjKiTGpYJfG8Exv6VQE5Hk13CnkcOBzrU8f6fdyRS0ojKmB4jPy8FRfk/aPFMuWp IPHA== X-Gm-Message-State: APjAAAXgVggZqXhtLPA/TEXbrXjn8jAhs9Vt8c0TNvF79D+URJVG5VL/ 0cvtx34wgUnqBxAFEEmLfxTAiyIV 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 Subject: [dpdk-dev] [PATCH 1/2] mk: fix missing pci bus with shared library build X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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)