From nobody Sun Feb 8 12:16:02 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=1754315920; cv=none; d=zohomail.com; s=zohoarc; b=lNETAfGrZ34UnmZCaLt5Pl0vwy31AlqvsghzeDTdI4fGHY4Kewd36AN1VWgf9S1QC5zNLGls5BlI0rtjUBKC8AP0Y53BtVpCeWuYBYiz2LNIfh8I1cS6j+izzNqAU8zSg7YH0DXxk88NY8URRMpRko9qoxMXHsCaNl6CPLXWOpM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754315920; 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=YUuth8HbNH8Ia7rPyHh7evcGT1DKrq1MlXctr0Y3ZAs=; b=SaX6BhduOfKHyYmJaaUUgu+NE3xy9Svh5P+12o6+aIKaqtPrVOhFfGltUzqg8pJpLT46hpVRXmebzuYGjTNxtxsmzDBPd9dQAWJ8tfIjBWVdEDvjnozvx6yivQl6EGONslEmu8n6wKXfafxBB4IJtaVh0sd8/7WQv2ecPbWXeas= 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 1754315919994402.4296348094674; Mon, 4 Aug 2025 06:58:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uivhi-0006ZQ-Nf; Mon, 04 Aug 2025 09:58:19 -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 1uiulH-0004MY-3v for qemu-devel@nongnu.org; Mon, 04 Aug 2025 08:58:04 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uiulF-0000T2-Be for qemu-devel@nongnu.org; Mon, 04 Aug 2025 08:57:54 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-747e41d5469so3392444b3a.3 for ; Mon, 04 Aug 2025 05:57:52 -0700 (PDT) Received: from ktock.. ([240d:1a:3b6:8b00:d117:15e5:e721:f1cd]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-76bcce8f800sm10488308b3a.42.2025.08.04.05.57.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Aug 2025 05:57:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754312272; x=1754917072; 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=YUuth8HbNH8Ia7rPyHh7evcGT1DKrq1MlXctr0Y3ZAs=; b=mzJbyslYKUkEx58avSq1dtwcyj6/hOU/cRvuYjGxKQZfaCrqzV1HDljR3zcFZrPxeW cVvu25+vJNYwq5Be7gRn30woYFanQmV92JdAc6M6hRp969EE2XV+c1uUr1VqZ46CYGcY SfeXhsyGhWLQyR6llGWrOxERJC+/tyZnYUevANnhTOEsHKEiMxQryy7CAXLj2mP85Urz x4g3E/lCR+cBq4dti2bqKzN+Gma4NauuGEgPcvhGXUTTBO8lRenfhCI/jVyPVNDJrtH4 tAnJbYMD55VciGg3p2JX2VUkix7bj15iLrKx4p9xy7ywoEU3XBJ81p6PIuL6TYnjU1xj MfXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754312272; x=1754917072; 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=YUuth8HbNH8Ia7rPyHh7evcGT1DKrq1MlXctr0Y3ZAs=; b=BS7YV1ZNEbWtmVGVN/pr7mftWEG5YVoMGpJNgded5aN0q84e5aQHkwzqJFL8kXNjiA hqGmzkAsMWaKJ2yFODuhv4aRpuFiKSkzRR+1SOZssgSIp1D8P9PaKWxb1WmVwtMDz2Kq BfSSuplrdY7kczi2jq5EOuQPop3poMEzMFKvOE/FwD0jtLaREgXwA3/g0NmVrJbKUTfk 70uPE9SzyvN5cVrX8qb996gvEkWqkkGoY+LkRZC+KPnAR0+ZFxHl0iy7ubiPbPEB8II/ pEZ7VDqPlJV60qh/gwxpWAA180NShpw4Z5Oeom1xYtWP3kWjgnv0An5Ns+BN2L4IR9ym ngKg== X-Gm-Message-State: AOJu0YznPguuGhDzRsKQ7Od3WjP3DKhladssSjb8+Qe0tSQLwKovwT6y LoK/KmIwm9daXUoyHO+Hm7WPTdlWl4wjh02UINVfi/l3UBHY6fcD2vSyZz7ZTA== X-Gm-Gg: ASbGncupGCGzfXOXoBoJ9D8FXA5f2PEwIBkSznpSchUGzr3YrimeqV3oqkO6dQILJRL H51SSy8w+t2qVh5qB5xZI70SRERV46kgbqIgEbKKjHoJr6Aq+qn9+UGLnbiwadXBD+stY3OQTC1 eNSfQVvaWZSgOt/Rd4m9cgjaLm2IaCCGnZO7MDfTGQ1CuwTOtvHguiUAVL1R//PNrkaEVFOPc+O dWKzpvZFZk6mOENuUqVvfTPzH+/tbrPDUxG66KPFyrADekGUzbchecI5We5mlyHXAFMPf69IDn2 l8emEXKcQVXC6XHxaj0zR7E7Y6YFMckWh+/W+gRossCSBXHsPRJxUiyiopCfpUijWXER+2QX6CY lT4A90mUtOiVccBjIqYr4zw== X-Google-Smtp-Source: AGHT+IFGWFxcWqTy9uYd49JJ/Z0krs9Q/OT2j7KygQvVsFwjPb/8Rp/5tZRIcoDCG+9qfYVdwCl1xA== X-Received: by 2002:a05:6a00:2295:b0:76b:caa5:9a32 with SMTP id d2e1a72fcca58-76bec489607mr11071554b3a.11.1754312271852; Mon, 04 Aug 2025 05:57:51 -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 2/4] configure: Enable to propagate -sMEMORY64 flag to Emscripten Date: Mon, 4 Aug 2025 21:57:15 +0900 Message-ID: <9e9d4d6e10a2eaaca2d741184ba292d699ddff7b.1754310749.git.ktokunaga.mail@gmail.com> 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::429; envelope-from=ktokunaga.mail@gmail.com; helo=mail-pf1-x429.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: 1754315922303124100 Content-Type: text/plain; charset="utf-8" Currently there are some engines that don't support wasm64 (e.g. unsupported on Safari[1]). To mitigate this issue, the configure script allows the user to use Emscripten's compatibility feature, "-sMEMORY64=3D2" flag[2]. Emscripten's "-sMEMORY64=3D2" flag still enables 64bit pointers in C code. = But this flag lowers the output binary into wasm32, with limiting the maximum memory size to 4GB. So QEMU can run on wasm32 engines. This commit adds "--wasm64-memory64" flag to the configure script. This takes the value to propagate to Emscripten's -sMEMORY64. 1(default) targets wasm64 engines and 2 targets wasm32 engines with still enabling 64bit pointers. [1] https://webassembly.org/features/ [2] https://emscripten.org/docs/tools_reference/settings_reference.html#mem= ory64 Signed-off-by: Kohei Tokunaga Reviewed-by: Pierrick Bouvier --- configure | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 7f3893a42f..8573f84e26 100755 --- a/configure +++ b/configure @@ -182,6 +182,8 @@ EXTRA_CXXFLAGS=3D"" EXTRA_OBJCFLAGS=3D"" EXTRA_LDFLAGS=3D"" =20 +wasm64_memory64=3D1 + # Default value for a variable defining feature "foo". # * foo=3D"no" feature will only be used if --enable-foo arg is given # * foo=3D"" feature will be searched for, and if found, will be used @@ -239,6 +241,8 @@ for opt do ;; --without-default-features) default_feature=3D"no" ;; + --wasm64-memory64=3D*) wasm64_memory64=3D"$optarg" + ;; esac done =20 @@ -537,7 +541,7 @@ case "$cpu" in CPU_CFLAGS=3D"-m32" ;; wasm64) - CPU_CFLAGS=3D"-m64 -sMEMORY64=3D1" + CPU_CFLAGS=3D"-m64 -sMEMORY64=3D$wasm64_memory64" ;; esac =20 @@ -795,6 +799,8 @@ for opt do ;; --disable-rust) rust=3Ddisabled ;; + --wasm64-memory64=3D*) + ;; # everything else has the same name in configure and meson --*) meson_option_parse "$opt" "$optarg" ;; @@ -920,6 +926,8 @@ Advanced options (experts only): --disable-containers don't use containers for cross-building --container-engine=3DTYPE which container engine to use [$container_eng= ine] --gdb=3DGDB-path gdb to use for gdbstub tests [$gdb_bin] + --wasm64-memory64 Used only for wasm64 build. Set -sMEMORY64 of + Emscripten to 1(default) or 2 (choices: 1/2) EOF meson_options_help cat << EOF --=20 2.43.0