From patchwork Fri Jul 26 16:36:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 57179 X-Patchwork-Delegate: thomas@monjalon.net 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 D87681C4CF; Fri, 26 Jul 2019 18:36:24 +0200 (CEST) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 7DF121C4C7 for ; Fri, 26 Jul 2019 18:36:22 +0200 (CEST) Received: by mail-pg1-f195.google.com with SMTP id f5so16207318pgu.5 for ; Fri, 26 Jul 2019 09:36:22 -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=iBO3ojFvjRHnnfLE9rj4vTEHxobkYz9FYtCShouzcBp78yF+RFToRB5nyn9DTm45I4 xlrtlQLuypdOy3m6kF+fl1gN+vs0kzhLNBy6e4fOfoWRPgpej9jdNog0vUbV2Oixn/im V6Xfnoj2pHvBCV0hni8adHLOErteMUJd2hPPy2ZHd/fqFMpA+0tCROoGcH9rsKfG8dBO DoeyWA9mZ69s77fRuWN/7gAQ6j8cmCVPy90BEc9n+rL5FiNtqHrhbEdvcObOhEtWmwCP 1tGt3uKZDjjJ2giuuJFyB63hdG9OFoQWeLPIxjRjj3yWvy34Wg2NDRQ2DcuuuaRwaweB Vvaw== X-Gm-Message-State: APjAAAV4+cBni4nvQIA5MacUGc1wZGloV2hob7N3PfsfkeJbKVO12ifU e5FjuzH2aeho1BYGKl2eqKuIuxzI 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 Subject: [dpdk-dev] [PATCH v2 1/2] bus: 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)