From nobody Mon Feb 9 19:12:21 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1754535861; cv=none; d=zohomail.com; s=zohoarc; b=OzA3O1hFFbau7L5hDfjm2WZ3kNLXW00XwHqKejdwI+RLWdl9skWT2+c/4tBtiVOk3sEfL2COpeZGc/ZXMCTt6D5bGqCdvCLiYYFT0q5yMf0ciCD8KHhb5lqS+RUovEz69qAf/ZncQFVqSK3B1pYOoYOWNbAHE43zVj0AOl2wECA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754535861; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xJlOz+Jg5Eh+vkwIFvbU82F8MEu7BNgLBhpUCzS/X/E=; b=QI0oMWWHqgi/mHNW/DSosiITK0NumoD+1lzqAS04UvumWXs08taq7Cl1wTHYLBsrmgO0sqemyJAkeiSgSjE71FPKViZJn+8Gf2nnhGIOTTa3Cwx4h2CR9OdlKgcD++XLoEwcYVs3a9ckMJ8BgNpeIZEiB3Lwcm5er2/2akLIeRY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1754535861686224.28782862970354; Wed, 6 Aug 2025 20:04:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ujquP-0007rC-GX; Wed, 06 Aug 2025 23:03:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ujqu6-0007jl-5U for qemu-devel@nongnu.org; Wed, 06 Aug 2025 23:02:55 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ujqu1-00026B-PN for qemu-devel@nongnu.org; Wed, 06 Aug 2025 23:02:52 -0400 Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-b4272ea5dbbso426851a12.1 for ; Wed, 06 Aug 2025 20:02:43 -0700 (PDT) Received: from ktock.. ([240d:1a:3b6:8b00:81e2:9f1d:777a:7b46]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-241d1ef6ac6sm173154585ad.1.2025.08.06.20.02.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Aug 2025 20:02:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754535762; x=1755140562; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xJlOz+Jg5Eh+vkwIFvbU82F8MEu7BNgLBhpUCzS/X/E=; b=mS95ZPDYt8cyhN5CFqd1sR4UhnGYOs6rWXaK6UltMRsZSI+IePzuFu5YLQKk3k4alb hpPlw/c0w+lBM8Ch1fWKFuvmWXTovnu1lqZamB0gLAJjD1CyyBCShR3hBDTd1dHIedRt AMpOi1EPtRCMJR0NVTsS27DlQTb6H7W5PsUdkfXpQjsZxmuH7Vo0NNaU9FtWYOn/Tvzl 6sOEhBfgJtPu1ubGWDzESseLtsM0p2WA9kwY2ZJUBLdpaWjgeoQj0wFgWeyBtL3/N/G/ i/Ieon2bZqXfrwfCGwyoI2GRoEjb1+/gTw/YfHSD+TTASg9hwj2CWFv+FcPq99EAaa3I Ff2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754535762; x=1755140562; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xJlOz+Jg5Eh+vkwIFvbU82F8MEu7BNgLBhpUCzS/X/E=; b=AGJl2OLVP0duXC1zwNrWBF5NGjyjTBj3eGAEZ+bR7YDWGbuzYbauc0BXI6HbkPIU4o cjFFNoZWZfQLD56LoKLoSa5p70AgzcBniNitNH0Tsnky5ZmhM8JZLcQxTPT8LjSwIa9u RcWDOR7l9XuzsURQYHXv/Vdl/Z/vZrExSQski2HNreNBztKdnSBubxXfqvHbbO6FuX+N J+0PUTwx/Kd953V5dT9gJ1d3v+BTdILfidI+o8wt/M2z9nxeUCvT2oNNFt15uxN/K0Em sThpyGsNV/erre5NTyexf6gsA87T7/eMF79osYfuKGwqJvuImMKhdF2Gc3I4bjki/OXA dt/Q== X-Gm-Message-State: AOJu0Yz/rMMayM/OWiYz/A5Ii0zrHGK9WpYjTUytimbDdZI1cJBVSVqq ZXdD7xhskbz8pN0OORxckA5Jl5c+JQS0+nKuagqGp0sq6ZDFg56ufli/sYiHRw== X-Gm-Gg: ASbGncvTrTdmhYLgzyWF8JCFwhlHAsDDOkTEvbbSU19HincfWqjGrC9GK811JBeXusR 7ZiCxyOj1tYtgrwHlaf3AWhXzk5IlCHSSkVsTBddcTmVB6YazIFI+UBSIowtJ7g0HA2DmGPa9wO 36PTuEXGSwpNcorugMV5nCXKNo4whwCOeA8bFVtB0aSeHST/phIf95R2k/YJuTd/dhkXMzTh/0b GbJbnO3LKiGMALL3+8gJ4c6kOPGqCXIOdkhzSwuLIlfeCSBtZ7GbkZN4wSd8YAFS2+6vM3dmmpC R4Q0KLBktR8eySqjJqZ3CjYX5iL0e3xDCMKWohn4YDw2wGtWnhj2RFHqn5kvSRHRlvQWj0RBFeM xEOv3OeKu2nja8zBTOQqjZg== X-Google-Smtp-Source: AGHT+IGYPOBKzfPnZYzxTD/JeBtsCGGBmHMl5CEfmX10XVJXSWTAHsUelalGnAzLuXoGknD0x/eOQw== X-Received: by 2002:a17:902:f78a:b0:231:d0da:5e1f with SMTP id d9443c01a7336-242b0704556mr25742275ad.21.1754535762170; Wed, 06 Aug 2025 20:02:42 -0700 (PDT) From: Kohei Tokunaga To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Stefan Hajnoczi , Pierrick Bouvier , ktokunaga.mail@gmail.com Subject: [PATCH v3 1/4] meson: Add wasm64 support to the --cpu flag Date: Thu, 7 Aug 2025 12:02:00 +0900 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=ktokunaga.mail@gmail.com; helo=mail-pg1-x536.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1754535864522124100 Content-Type: text/plain; charset="utf-8" wasm64 target enables 64bit pointers using Emscripten's -sMEMORY64=3D1 flag[1]. This enables QEMU to run 64bit guests. Although the configure script uses "uname -m" as the fallback value when "cpu" is empty, this can't be used for Emscripten which targets to Wasm. So, in wasm build, this commit fixes configure to require --cpu flag to be explicitly specified by the user. [1] https://emscripten.org/docs/tools_reference/settings_reference.html#mem= ory64 Signed-off-by: Kohei Tokunaga Reviewed-by: Pierrick Bouvier --- configure | 6 +++++- meson.build | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 825057ebf1..7f3893a42f 100755 --- a/configure +++ b/configure @@ -365,7 +365,6 @@ elif check_define __APPLE__; then host_os=3Ddarwin elif check_define EMSCRIPTEN ; then host_os=3Demscripten - cpu=3Dwasm32 cross_compile=3D"yes" else # This is a fatal error, but don't report it yet, because we @@ -425,6 +424,8 @@ elif check_define __aarch64__ ; then cpu=3D"aarch64" elif check_define __loongarch64 ; then cpu=3D"loongarch64" +elif check_define EMSCRIPTEN ; then + error_exit "wasm32 or wasm64 must be specified to the cpu flag" else # Using uname is really broken, but it is just a fallback for architectu= res # that are going to use TCI anyway @@ -535,6 +536,9 @@ case "$cpu" in wasm32) CPU_CFLAGS=3D"-m32" ;; + wasm64) + CPU_CFLAGS=3D"-m64 -sMEMORY64=3D1" + ;; esac =20 if test -n "$host_arch" && { diff --git a/meson.build b/meson.build index e53cd5b413..291fe3f0d0 100644 --- a/meson.build +++ b/meson.build @@ -52,7 +52,7 @@ qapi_trace_events =3D [] bsd_oses =3D ['gnu/kfreebsd', 'freebsd', 'netbsd', 'openbsd', 'dragonfly',= 'darwin'] supported_oses =3D ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', '= sunos', 'linux', 'emscripten'] supported_cpus =3D ['ppc', 'ppc64', 's390x', 'riscv32', 'riscv64', 'x86', = 'x86_64', - 'arm', 'aarch64', 'loongarch64', 'mips', 'mips64', 'sparc64', 'wasm32'] + 'arm', 'aarch64', 'loongarch64', 'mips', 'mips64', 'sparc64', 'wasm32', = 'wasm64'] =20 cpu =3D host_machine.cpu_family() =20 @@ -916,7 +916,7 @@ if have_tcg if not get_option('tcg_interpreter') error('Unsupported CPU @0@, try --enable-tcg-interpreter'.format(cpu= )) endif - elif host_arch =3D=3D 'wasm32' + elif host_arch =3D=3D 'wasm32' or host_arch =3D=3D 'wasm64' if not get_option('tcg_interpreter') error('WebAssembly host requires --enable-tcg-interpreter') endif --=20 2.43.0