From nobody Mon Feb 9 08:33:47 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=1767892344; cv=none; d=zohomail.com; s=zohoarc; b=SdCY8cLq++eHFVtHeMdVwYcj04yqQwGN4fbivYuCrowuc0z0ohTSdBJ/NUQZMr6H5tdklD6fp+ToX1oUXzlvWuk/+RlHtzfk9YCFGDo23NrmD2x9EICW6Cyzyg0U9arjSWW94lG0zDSIPR2f5fJD4pOXKELir/R42VuW+xt1Gok= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767892344; h=Content-Type: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=KSK09h4xKjsISSidIbADfOirq0TnGihmtXpNzolifyA=; b=aZyZ8wZS2V8P5R3xCajbMlGby6+xi/EPi2CUYC36kNWD+0sTPHmeFCnVFppCmeY69P0zwab22QaX0ByZ+Oc9VxXb96bhp8kmSSWXviH1nhKNSbKHLGJgnMLaAmGBCMV2rKr6l86VjtOz1JSekQEsbT5F7DVfibV3mJNKR9nLzmU= 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 1767892344519743.6756814611747; Thu, 8 Jan 2026 09:12:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdtYU-0000rW-Oh; Thu, 08 Jan 2026 12:12:14 -0500 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 1vdtYS-0000p1-Lr for qemu-devel@nongnu.org; Thu, 08 Jan 2026 12:12:12 -0500 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vdtYR-0000EM-1B for qemu-devel@nongnu.org; Thu, 08 Jan 2026 12:12:12 -0500 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-7aa2170adf9so2131053b3a.0 for ; Thu, 08 Jan 2026 09:12:10 -0800 (PST) Received: from ktock.. ([240d:1a:3b6:8b00:7ace:63ca:408f:4cc4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a3e3c3a507sm82808355ad.3.2026.01.08.09.12.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jan 2026 09:12:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767892329; x=1768497129; 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=KSK09h4xKjsISSidIbADfOirq0TnGihmtXpNzolifyA=; b=TPX5UbspAs0hs3M7LshnQ9H9ihHtBbwKQEwcVoP/4eylFkqzZ7SZi8R9i69OXjkjyG 5D2xIygL+TCJ793+gkl68Vtclj12iLy4xvzf5EXTagzTWXw39UFjrabStKtCpnMB2Gz8 S+y+zDn+3IlhMP3G7J1qI/cfOX2TZ97349d31CgaUuC6tuYyinWa8vPjR93WrTGpTnuG NRepfCSHwIB9H+cd0jBviZcoGm4NV5DCb0szGxHGQbvfK3W2l5jzys7/Pj6uU2XG7Ljf WvjuwnfeBELZf70NKQ4vIWLVoAvoeFv0/VnbQvDMRp4iRn8mM8EaA/KLO58LfS4TjEpb zpAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767892329; x=1768497129; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=KSK09h4xKjsISSidIbADfOirq0TnGihmtXpNzolifyA=; b=MtLQdQqQhBfGZRO1b8adDr6nykyHrcvwTbX0CDfGZ76RsIBlZ/XrfQp6iiRRHrT8Nx kZGBUDtDv0beoTJJNVxgWgEePMCGsZhU3ZSLf/ot2hm2gj6bCVoLKaZigE4T3Qm92Bnq HgUTepfJvLyQqMryM77Oz867eHujF9nYLNKBO4Uqrpg1OtZhXFaUBOJmgbAZN3qeIK2K QxuAHXrE1flk5ZL2Fs5v9FkD/QsJBnTkpaqVyicqi36fq2JFKFOkWJyEmYB6vvlyERSx xh4CB+ayMk+6c7NWkHgJWDPiiGVxWyq/vIYdRN+SsaxVEObFQbDCJIGMR3DDG04jXsMw RMFQ== X-Gm-Message-State: AOJu0YzxJGJKQAfO9ZXMY4H99RNb3L0uejcIq7bbhsIJk5I6kvkUXUiz 0jj/5YBsWp+N7P4+tkhRHiona65+Kos3Yp0aSzxhlI2OExjwnXvit6Oc2q76PwWJ X-Gm-Gg: AY/fxX6uqB4emBke2S2IDna7kAcM6ROk1voS+jVQ3LvGb4A2C56p2Xl9K0Q+XeDKKP6 Xtfyb9RLb+EcoEKM8A85m51FAQTLnIe1cc9/5Ld831bZ/nAt9Wg5lp1newrfAMyIRc2MLAKBi81 AnMlg5jWcej7WnYbrBjJpwOVAVF2JqKY7/AVp0vd+z92tHCCEweJJ8A73UISupdVbgTX7xODTVa h5Si7BodX571PND5AybJaau/Uuqz8plXt2GMLSz+0+yoMAzSSjbPuwYdRHtfgQh8fNxK18BnMU5 vAqplGrXTktryZWIbSfRdyZ8v+N+NWUGlM848VRv1slRGZSndepfOmYEqeyqKGAuST74j9MFBFg X5Azm3HUhg50Yz4HZ64mLLQ8MqjAOLze6knqS4xae2HaoCSblfRY98TzgX3X5nkfvGA3yxLDF9k CQujpZUlHWhw== X-Google-Smtp-Source: AGHT+IE6hOP0aJJspvb7o/9YaIT/qdhZ+oI7HN43/4DVGM9ezRtCg7GHzoXuyNgnWzBGVA4nzWGcEQ== X-Received: by 2002:a05:6a20:7486:b0:35f:b243:46cb with SMTP id adf61e73a8af0-3898f8f4c75mr7271084637.12.1767892329400; Thu, 08 Jan 2026 09:12:09 -0800 (PST) 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?= , Kohei Tokunaga , Stefan Hajnoczi , Pierrick Bouvier , Richard Henderson Subject: [PATCH v4 2/4] configure: Enable to propagate -sMEMORY64 flag to Emscripten Date: Fri, 9 Jan 2026 02:11:26 +0900 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 (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::433; envelope-from=ktokunaga.mail@gmail.com; helo=mail-pf1-x433.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: 1767892346368158500 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. [1] https://webassembly.org/features/ [2] https://emscripten.org/docs/tools_reference/settings_reference.html#mem= ory64 Signed-off-by: Kohei Tokunaga Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- configure | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 92bfc5f976..326d27dab1 100755 --- a/configure +++ b/configure @@ -182,6 +182,10 @@ EXTRA_CXXFLAGS=3D"" EXTRA_OBJCFLAGS=3D"" EXTRA_LDFLAGS=3D"" =20 +# The value is propagated to Emscripten's "-sMEMORY64" flag. +# https://emscripten.org/docs/tools_reference/settings_reference.html#memo= ry64 +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 +243,8 @@ for opt do ;; --without-default-features) default_feature=3D"no" ;; + --wasm64-32bit-address-limit) wasm64_memory64=3D"2" + ;; esac done =20 @@ -521,7 +527,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 @@ -779,6 +785,8 @@ for opt do ;; --disable-rust) rust=3Ddisabled ;; + --wasm64-32bit-address-limit) + ;; # everything else has the same name in configure and meson --*) meson_option_parse "$opt" "$optarg" ;; @@ -904,6 +912,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-32bit-address-limit Restrict wasm64 address space to 32-bit (de= fault + is to use the whole 64-bit range). EOF meson_options_help cat << EOF --=20 2.43.0