From patchwork Tue Feb 27 19:21:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 137397 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: 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 1AA2C43BBE; Tue, 27 Feb 2024 20:22:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8A92F42EE6; Tue, 27 Feb 2024 20:22:06 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 385AB40A81 for ; Tue, 27 Feb 2024 20:22:04 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 8ECB420B74C1; Tue, 27 Feb 2024 11:22:03 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8ECB420B74C1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1709061723; bh=vRo/iMpbsd/Y4YBaGdoczWg40eyG7WmqFS6YhGS6mS0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ekBk5eXrfhFV3iWNPTStMCQbTrkqKC5S2LzF24NVZdBYRjL9EIHhKWfZgRVZtqty0 cvqC8Mr5L4yjSIFOcqd1Jxy2C0YwhfbEoqT5FV/r/3wAy6mz5vP2303tIel1HuRfZr CERrtO+8Ch5KmEYa9lu2G1xjIerB39MFJtbZGCqM= From: Tyler Retzlaff To: dev@dpdk.org Cc: Bruce Richardson , Tyler Retzlaff Subject: [PATCH 1/2] build: build eal library with MSVC Date: Tue, 27 Feb 2024 11:21:59 -0800 Message-Id: <1709061720-4843-2-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1709061720-4843-1-git-send-email-roretzla@linux.microsoft.com> References: <1709061720-4843-1-git-send-email-roretzla@linux.microsoft.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org * MSVC now has limited handling of GCC __extension__ keyword when compiling C so only expand __extension__ empty on MSVC when building with C++. * When building with MSVC enable the statement expressions compiler extension. * When building with MSVC enable building of eal library. Signed-off-by: Tyler Retzlaff --- config/meson.build | 7 ++++++- lib/eal/include/rte_common.h | 2 ++ lib/meson.build | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/config/meson.build b/config/meson.build index f8f2149..68186e1 100644 --- a/config/meson.build +++ b/config/meson.build @@ -39,13 +39,18 @@ if is_ms_compiler # temporarily disable msvc specific warnings # - 4244 compiler detected conversion of integer to smaller type # - 4267 compiler detected conversion of size_t to smaller type - add_project_arguments('/wd4244', '/wd4267', language: 'c') + # - 4146 unary minus applied to unsigned type + add_project_arguments('/wd4244', '/wd4267', '/wd4146', language: 'c') # enable non-locking atomic operations add_project_arguments('/experimental:c11atomics', language: 'c') # enable typeof operator add_project_arguments('/d1experimental:typeof', language: 'c') + + # enable statement expressions extension + add_project_arguments('/experimental:statementExpressions', language: 'c') + endif # set the major version, which might be used by drivers and libraries diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h index 1cc1222..99128d8 100644 --- a/lib/eal/include/rte_common.h +++ b/lib/eal/include/rte_common.h @@ -38,8 +38,10 @@ #endif #ifdef RTE_TOOLCHAIN_MSVC +#ifdef __cplusplus #define __extension__ #endif +#endif /* * RTE_TOOLCHAIN_GCC is defined if the target is built with GCC, diff --git a/lib/meson.build b/lib/meson.build index 4fb01f0..d77bfbc 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -73,6 +73,7 @@ if is_ms_compiler 'log', 'kvargs', 'telemetry', + 'eal', ] endif From patchwork Tue Feb 27 19:22:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 137398 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: 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 0D2FC43BBE; Tue, 27 Feb 2024 20:22:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CBE3742EFB; Tue, 27 Feb 2024 20:22:07 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 4997242EC7 for ; Tue, 27 Feb 2024 20:22:04 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 9C60220B74C2; Tue, 27 Feb 2024 11:22:03 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9C60220B74C2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1709061723; bh=bf9pdNnUYfKO3Vr5wZuKkSQClS1dHWH0q7xIZ3whMjo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j7SMMUb/YlHVKgcNsvjo+dDMk4C/pxCRjQayKiFkQhFkLJKMVQ18+PeBTYDQGX4VJ ejX61uopy61/osHUpLiGIZNTr+7J4Nihv3S2XVsTlrm+FRZHnFmq8wn/LvQfSldKoS J6RrbHcGuBsug0QwonH8HLLl1W4TXg885YpbH6+U= From: Tyler Retzlaff To: dev@dpdk.org Cc: Bruce Richardson , Tyler Retzlaff Subject: [PATCH 2/2] build: build ring library with MSVC Date: Tue, 27 Feb 2024 11:22:00 -0800 Message-Id: <1709061720-4843-3-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1709061720-4843-1-git-send-email-roretzla@linux.microsoft.com> References: <1709061720-4843-1-git-send-email-roretzla@linux.microsoft.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org * Use RTE_USE_C11_MEM_MODEL when building with MSVC. * When building with MSVC enable building of ring library. Signed-off-by: Tyler Retzlaff --- config/meson.build | 3 +++ lib/meson.build | 1 + 2 files changed, 4 insertions(+) diff --git a/config/meson.build b/config/meson.build index 68186e1..b995ac6 100644 --- a/config/meson.build +++ b/config/meson.build @@ -32,6 +32,9 @@ if is_ms_compiler # does not support inline assembly dpdk_conf.set('RTE_FORCE_INTRINSICS', 1) + # force the use of C++11 memory model in lib/ring + dpdk_conf.set('RTE_USE_C11_MEM_MODEL', 1) + # suppress warnings raised for using standard library functions # the MSVC compiler regards as unsafe but are used by DPDK dpdk_conf.set('_CRT_SECURE_NO_WARNINGS', 1) diff --git a/lib/meson.build b/lib/meson.build index d77bfbc..179a272 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -74,6 +74,7 @@ if is_ms_compiler 'kvargs', 'telemetry', 'eal', + 'ring', ] endif