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 1FA95A0562; Mon, 30 Mar 2020 06:11:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8AAC61C0B4; Mon, 30 Mar 2020 06:10:51 +0200 (CEST) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by dpdk.org (Postfix) with ESMTP id E2B871C06A for ; Mon, 30 Mar 2020 06:10:45 +0200 (CEST) Received: by mail-lj1-f193.google.com with SMTP id p10so16348782ljn.1 for ; Sun, 29 Mar 2020 21:10:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nO1QQJVim9JFENiH/t3tc3Fw1dB59cjR6wDP6/cieIc=; b=RcWJIWGJpMIVZzahYkNMawRzKrgvkqm+dVLj6rZYylI++ezxDGZ/QwislMLLqAcWQK zrNmlGdYelGA+2LI3h0F8dpPOfADaT3zFfS0OvOwCmg7S1x0mBkFnUbo/C7ev6Z/217b 0UbTOU7GaD3V5wTORq1laUj8XFpTpNq4kSXa9TCKLq9nLBP5vasT5JMqGXSJv3j3EdSE jYF0lLl75pEaoI0j+q6Pbwr5VpKLdzOlvrumaRxS+vreH/Hkuh0K17GZEHYsErIMouxK XicutD2YKphSUGDrvwDNxW8RZ+X8VqbMXHcUeXavcboJ3IbFsz2JF7p2t6AkHN34F589 7z8w== 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=nO1QQJVim9JFENiH/t3tc3Fw1dB59cjR6wDP6/cieIc=; b=NMcYMxgK+8M0q8OTqOIOdRt2KAfx5hnQnrV0Kwtzeh9Mbn8hbz/OPjna+QACHRDho6 BG8Zs8au1uJAxwa5ydnCa6Rx+b/ClZZje3UmTQh1aaaBj05FYzse36OzLXeTZ8ojIYKA xaKsRv1S+2LmdEzUZopsHPma+0c8LSv+vsxr/jBan1Sj3T/j5FmDsEeX4Klrmj/x4mr2 xaXuLe87XEt3/9ukdfN6CfrvAWZZP38Pv8vyzc9JVFzh8hWJNfKykb/81uK6hA7IB77J RpeeEjlQmlYS3C1w1CiLhdBxNNvJ/1pVoiRRSppxQaf6fL3LI/PNpJhnIg1aNDNYHZrX pmOA== X-Gm-Message-State: AGi0PuYmOC8rqWR4I1VlignAIfCuJCgWJKYEKqknV/pzq2qul/3B66OC 62aUz2AYMoyeKlQXHm8nkDEZURhifXGyIA== X-Google-Smtp-Source: APiQypIYGdMWvxAGtBV4VvUClpmz0k3S7R4aQsGYWjoi/3qe3pjfYXvXAN7dndvh1f+ZxWA8UMuC2g== X-Received: by 2002:a2e:9611:: with SMTP id v17mr6010955ljh.115.1585541445186; Sun, 29 Mar 2020 21:10:45 -0700 (PDT) Received: from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.googlemail.com with ESMTPSA id c22sm6210036lja.86.2020.03.29.21.10.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Mar 2020 21:10:44 -0700 (PDT) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: "Dmitry Malloy (MESHCHANINOV)" , Dmitry Kozlyuk , Anatoly Burakov Date: Mon, 30 Mar 2020 07:10:24 +0300 Message-Id: <20200330041026.784624-8-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200330041026.784624-1-dmitry.kozliuk@gmail.com> References: <20200330041026.784624-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [RFC PATCH 7/9] eal/windows: fix rte_page_sizes with Clang on Windows 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" Clang on Windows follows MS ABI where enum values are signed 32-bit, Enum rte_page_size has members valued beyond 2^32. EAL cannot use -fno-ms-compatibility because its code is OS-dependent. The only option is to define these values outside enum, but this prohibits using -fstrict-enums. Another consequence is that enum rte_page_size cannot be used to hold page size, because on Windows it won't be able to hold all possible values. Signed-off-by: Dmitry Kozlyuk --- lib/librte_eal/common/include/rte_memory.h | 6 ++++++ lib/librte_eal/meson.build | 1 + 2 files changed, 7 insertions(+) diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h index 1742fde9a..5b0e2d8b5 100644 --- a/lib/librte_eal/common/include/rte_memory.h +++ b/lib/librte_eal/common/include/rte_memory.h @@ -34,8 +34,14 @@ enum rte_page_sizes { RTE_PGSIZE_256M = 1ULL << 28, RTE_PGSIZE_512M = 1ULL << 29, RTE_PGSIZE_1G = 1ULL << 30, +/* Work around Clang on Windows being limited to 32-bit underlying type. */ +#if !defined(RTE_TOOLCHAIN_CLANG) || !defined(RTE_EXEC_ENV_WINDOWS) RTE_PGSIZE_4G = 1ULL << 32, RTE_PGSIZE_16G = 1ULL << 34, +#else +#define RTE_PGSIZE_4G (1ULL << 32) +#define RTE_PGSIZE_16G (1ULL << 34) +#endif }; #define SOCKET_ID_ANY -1 /**< Any NUMA socket. */ diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build index 1730d603f..ec80bd6be 100644 --- a/lib/librte_eal/meson.build +++ b/lib/librte_eal/meson.build @@ -23,6 +23,7 @@ endif if cc.has_header('getopt.h') cflags += ['-DHAVE_GETOPT_H', '-DHAVE_GETOPT', '-DHAVE_GETOPT_LONG'] endif +cflags += '-fno-strict-enums' sources = common_sources + env_sources objs = common_objs + env_objs headers = common_headers + env_headers -- 2.25.1