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 D84B4A046B for ; Fri, 26 Jul 2019 18:36:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A22301C4CB; Fri, 26 Jul 2019 18:36:24 +0200 (CEST) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 191B11C4C3 for ; Fri, 26 Jul 2019 18:36:21 +0200 (CEST) Received: by mail-pg1-f196.google.com with SMTP id t132so25017271pgb.9 for ; Fri, 26 Jul 2019 09:36:21 -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=HaO++NL4b9U6pGwf6b4CZretZ/wpQrBEI8n8TFKjrNElDBG1ZzwUTukRXTgFRQeH8q GS+Zwbx58YFiTqOCM7IXLoyyLvKs6K5Skx6JQBu1KgYkd2v+xKNZIl08i4Vn/aCGRI58 aOIlO1hbK7lFYk24POdIVNHEuZ72FfE0SG0NFWLnRYwgWo4qUeNUQISoAyITZ9tIo08y 4oiNXMCwb8jiWx+Z4nsV4eUf9402QJRfKOAf8it4zCVJTbblly0B+ikMgAfXuUZZBnhA kGKBuukcWiPLfAVgAWoLIwCCS0QvHRiu6tjhhrfLhqlojPNpuT6ZKSjbwfI3yUdN0jLz 3BgQ== 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=pFrwZvVqE8S3EiKy5/Qc4oSnfszveJemAYCRvGXFexWdxs1GtD+/d1ujEVV7hp7UGj 2RlliyBG7SW62+KMpqbWNFDqlrKRqlG0bMq2CbNnyUmFNoRgcIWhdx68fcuifPRIgYgM LW/rzfYfi3gwGgnigFBhbgSq0qHXRE4Cny8iBZcgv+nyS0DaxvHnPiD6oYZjitjK8Sv/ Gr22hvwTi0QSsXF3BaG6I6nZAPWaNIC0ZfhPILCgh+A100Of7QnWvkb6iJ2EG83sj6Sg A9Pd96hZAO5zLDnNr0zaW1NjIyQkwNszi+I7mGlwqiSsjuLhyfrGl3+OHQytEvKqb8oI eQyQ== X-Gm-Message-State: APjAAAVPTRnCk/qXa3Cfzd1g0W2JO2P2ieIa28FsJnjbK3pIP2ItA3xU 8VLsYzCfZYAkCY/3OXoaKLg= X-Google-Smtp-Source: APXvYqz9IVCZQBhaV2RjSIR1lIGtAD7mhJ7KmrPvy2gJ5uQ+15kQSrVx0Z9c27cZxMseDxf1uzE3Pg== X-Received: by 2002:a63:1b66:: with SMTP id b38mr91821804pgm.54.1564158981144; Fri, 26 Jul 2019 09:36:21 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id m101sm42691781pjb.7.2019.07.26.09.36.19 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 26 Jul 2019 09:36:20 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , stable@dpdk.org Date: Fri, 26 Jul 2019 09:36:16 -0700 Message-Id: <20190726163617.29701-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190726163617.29701-1-stephen@networkplumber.org> References: <20190726163617.29701-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH v2 1/2] bus: 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