Message ID | 1735009552-31906-1-git-send-email-andremue@linux.microsoft.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 81C9845F26; Tue, 24 Dec 2024 04:06:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 04C1C402CD; Tue, 24 Dec 2024 04:06:16 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id EE6394029C for <dev@dpdk.org>; Tue, 24 Dec 2024 04:06:13 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id E7F9D206ADD4; Mon, 23 Dec 2024 19:06:12 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com E7F9D206ADD4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1735009572; bh=CG/JeBzuo7iSpZKmTLBdDYiEjRlGujop0LYB90uivHw=; h=From:To:Cc:Subject:Date:From; b=X7Cn7xXy3hSN41vg8WQipln6i3QEseLGypBJV5Es8N9M0uHy098TICbyjOSw0VQlp Wh2zLtOHbhgb8Zhptx7Hl4bBuuqWbQpo3hLqHU+Sleb2LlS3zAo9NYwDs+wBn0WVo7 fHbyjP/iz22VNWIhLZF4YTMmhi8OxvpPu/TnZ34E= From: Andre Muezerie <andremue@linux.microsoft.com> To: Cc: dev@dpdk.org, Andre Muezerie <andremue@linux.microsoft.com> Subject: [PATCH 0/5] use portable macro for weak linking Date: Mon, 23 Dec 2024 19:05:47 -0800 Message-Id: <1735009552-31906-1-git-send-email-andremue@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
use portable macro for weak linking
|
|
Message
Andre Muezerie
Dec. 24, 2024, 3:05 a.m. UTC
MSVC uses pragmas to indicate weak linking, so the old __rte_weak attribute needs to made into a macro so that the same syntax can be used for MSVC and other compilers like gcc. Andre Muezerie (5): lib/eal: add portable macro for weak linking app/test-compress-perf: use portable macro for weak linking drivers/bus: use portable macro for weak linking drivers/common: use portable macro for weak linking drivers/net: use portable macro for weak linking app/test-compress-perf/main.c | 36 ++++++++++++------------ drivers/bus/auxiliary/auxiliary_common.c | 8 +++--- drivers/common/nitrox/nitrox_device.c | 16 +++++------ drivers/common/qat/qat_qp.c | 4 +-- drivers/net/enic/enic_main.c | 4 +-- drivers/net/fm10k/fm10k_ethdev.c | 32 ++++++++++----------- drivers/net/hns3/hns3_rxtx.c | 28 +++++++++--------- drivers/net/nfp/nfdk/nfp_nfdk_vec_stub.c | 4 +-- drivers/net/nfp/nfp_rxtx_vec_stub.c | 8 +++--- drivers/net/virtio/virtio_rxtx.c | 8 +++--- drivers/net/virtio/virtio_rxtx_simple.c | 4 +-- lib/eal/include/rte_common.h | 14 ++++++++- 12 files changed, 89 insertions(+), 77 deletions(-) -- 2.47.0.vfs.0.3
Comments
On Tue, Dec 24, 2024 at 4:06 AM Andre Muezerie <andremue@linux.microsoft.com> wrote: > > MSVC uses pragmas to indicate weak linking, so the old __rte_weak > attribute needs to made into a macro so that the same syntax can > be used for MSVC and other compilers like gcc. > > Andre Muezerie (5): > lib/eal: add portable macro for weak linking > app/test-compress-perf: use portable macro for weak linking > drivers/bus: use portable macro for weak linking > drivers/common: use portable macro for weak linking > drivers/net: use portable macro for weak linking I am not a fan of the weak linking stuff in the first place. Reading the code with __rte_weak, I always wonder which symbol is used when... I prefer explicit linking and no duplicate symbols end up in the binaries. I posted a RFC, can you have a look? https://inbox.dpdk.org/dev/20250207083252.3131588-1-david.marchand@redhat.com/
On Fri, Feb 07, 2025 at 09:47:19AM +0100, David Marchand wrote: > On Tue, Dec 24, 2024 at 4:06 AM Andre Muezerie > <andremue@linux.microsoft.com> wrote: > > > > MSVC uses pragmas to indicate weak linking, so the old __rte_weak > > attribute needs to made into a macro so that the same syntax can > > be used for MSVC and other compilers like gcc. > > > > Andre Muezerie (5): > > lib/eal: add portable macro for weak linking > > app/test-compress-perf: use portable macro for weak linking > > drivers/bus: use portable macro for weak linking > > drivers/common: use portable macro for weak linking > > drivers/net: use portable macro for weak linking > > I am not a fan of the weak linking stuff in the first place. > Reading the code with __rte_weak, I always wonder which symbol is used when... > I prefer explicit linking and no duplicate symbols end up in the binaries. > > I posted a RFC, can you have a look? > https://inbox.dpdk.org/dev/20250207083252.3131588-1-david.marchand@redhat.com/ > > > -- > David Marchand I also had the same questions about which symbols were being used the first time I looked at the code. Therefore, I think your proposal makes the code easier to understand and is a better approach. -- Andre Muezerie