Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 556B8606A32C for ; Wed, 2 Dec 2026 20:22:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=EjTcyHvc Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xYqqC-0005Jj-6r; Wed, 02 Dec 2026 15:22:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYqq4-0005HP-Fj for qemu-devel@nongnu.org; Wed, 02 Dec 2026 15:22:04 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xYqq1-00044S-GU for qemu-devel@nongnu.org; Wed, 02 Dec 2026 15:22:04 -0500 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-2f03eeda984so73470725ad.2 for ; Wed, 02 Dec 2026 12:22:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1796242920; x=1796847720; darn=nongnu.org; h=content-transfer-encoding:content-type:in-reply-to:content-language :from:references:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to:content-type; bh=Ieux7oj4++GZbncrdeY/Ti6hu1JGfMMixYt4cITIxEs=; b=EjTcyHvc4IfhY82+hXnQEje2+hsYbhe4oXq39cyxKzsUVPoOaabbWOBRCfNtGAjInW ZfsX3LF62x4aerlLQYPyymHii73iWQQxneuBzPEsbluGvvY41xPOVLqH2N2gaNbrG9AC RyRDns4ZnaD8NBsG6bGlqkqNGx50izuFzfo4aX+LBS0tg+9lzm6Sy0XBPPGTmLdgFZw8 m/S6Z5k5nFoY2zCRMtD/AoqidbFbFUdriOJ0lQ1H89g3pj5+XBagmDS2w5xLvElpgAmD WFsd77zNplfXlQf/KjGEkXfyZSEIUZB2blPX0N0lHi4pvAYchlwrWUAHIcGt4A4GbEyw XjWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796242920; x=1796847720; h=content-transfer-encoding:content-type:in-reply-to:content-language :from:references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=Ieux7oj4++GZbncrdeY/Ti6hu1JGfMMixYt4cITIxEs=; b=SrBDKctfcDxBCh2bNwjOQ502JLbrJrWDaTAOO2DZaYYqVeEqIdJuEbaV2hBP/exffk DRofZ+Ri7fTAalbMAdIMfBSosvrvlZnHqdFqzVqeUgH3jQbEP0TvyWN23/P3y3RrMYeR CmhJI1PTwe1h0B9vJnNd2wLsjXDNUoKRpPCOXUVG0z8BFrK7+Lr82e6X3+KZCoZ7AdKi dCf7GEfeW906Psw1RNMHoo27sjLs/UJMq9bx9NlVzoRNzk/6jX82/wPTQWlQpXuVJG7+ BvcYRR1/2uUtfbQ2+yuh3FDyCdfq1mpgR9LY6Of+YqTJQBwvan/rBjQqFxgr2FYxn0tD hHYA== X-Forwarded-Encrypted: i=1; AL+hErEqz7A0pumJ5O9tsMwApj+CoxDt0THGP44mnb8njaQ72/DZxH8h78ZKgZKBYv/ftfH37OvnDQaL/yLj@nongnu.org X-Gm-Message-State: APuU4Z9sgmkeAaGFsS/Ep//8dUTWVf22/ISKTC3W9cHY0CDJh2rf+iiq BLzEIsDbNpxpNb6tidEjrZC1sHwEY7doNp6CL03w8rUswlQ6PCy5VcT6EqwKQVtPMHM= X-Gm-Gg: AZFdTZcsY1vL3wn7QQWV9AtcBVLGnBZxWpsM+MAAg6GGeB+agb9FPResGsgjBvBPluU oGoh5aQYxWwzVGAxlaCXN0g1jU4yUXWZU5Gm2LrlQpeWNlj8jKw1Tj7DIH8/Y4obzLm4pU9G5UJ dQDmnjqxmnS1uIC4sMHiAwMiJtFah4FCncON0dFnGZWkADFPTaK+X8kJpLPnl+LwozDVuEDEzs0 aei2cMmtGY5iCvUl0KYBEVi7sdw/P7WGVd3a9twt/5T3A/P/XEhIbIXcT3g3RX21e+tEAUFur/G wGcSDn+kA8+M7agbUm+FXxXIsmbtPqeKEOIUsXVSVYRpa3zd7uczOdIVF01ard644OXbKPW3BRY oBDWyS3cR9PnAh6G8UW9mY/CxfzFM2Iwvl93G7g076BpTmOuttfNrjxwoG1TFnwjtjcgPS/KBgY vijhu4uUqyvSZyeSkg3TwN2+ahlwl7lNP2/5vUO/eOf8/yzX7bx8vcKmC44kSRf4QNusrkoMwYA TaZsgr7Y7/hyiEVdaX1QP0xFXO6rOdqqNA4DA/zlZ1zwtLFNWJTCL5kB+o+fhbsS9Lnz56lyeeN Qw9gkQyuNAR3TH6JMLaIjjJjUJA+TgxHkQdhDoW0eKBPkDRgFATkTl/0gyBycBJm9P41CQ== X-Received: by 2002:a17:902:d48e:b0:2f0:8965:58e0 with SMTP id d9443c01a7336-2f089655a40mr390133525ad.4.1796242919876; Wed, 02 Dec 2026 12:21:59 -0800 (PST) Received: from [192.168.0.4] (174-21-68-150.tukw.qwest.net. [174.21.68.150]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f1542d2db2sm50376695ad.36.2026.12.02.12.21.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2026 12:21:59 -0800 (PST) Message-ID: <697571d6-8dbf-4a82-aad8-c88e963ba3bb@linaro.org> Date: Wed, 2 Dec 2026 12:21:58 -0800 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PULL 1/1] meson.build: windows-arm64 build fix, use _setjmpex instead of (removed) __mingw_setjmp To: Pierrick Bouvier , qemu-devel@nongnu.org, peter.maydell@linaro.org, pbonzini@redhat.com, stefanha@redhat.com References: <20261202004603.2002932-1-pierrick.bouvier@oss.qualcomm.com> <20261202004603.2002932-2-pierrick.bouvier@oss.qualcomm.com> From: Richard Henderson Content-Language: en-US In-Reply-To: <20261202004603.2002932-2-pierrick.bouvier@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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, 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: qemu development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-22.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_PASS,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On 12/1/26 16:46, Pierrick Bouvier wrote: > mingw-w64 removed __mingw_setjmp for aarch64, as its usage was > replaced by _setjmpex, which has the same functionality: > https://github.com/mingw-w64/mingw-w64/commit/326b51ef75c4dde099edb063a573b7d114a93af1 > > This change reached MSYS2 with toolchain update a few days ago, > mingw-w64-clang-aarch64-crt14.0.0.r757.g7dceb7d77, and configure now > fails on windows-arm64: > > ld.lld: error: undefined symbol: __mingw_setjmp > ../meson.build:3226:4: ERROR: Problem encountered: mingw must provide > setjmp/longjmp for windows-arm64 > > _setjmpex is provided by the Windows CRT, so this works with > both older and newer mingw-w64 versions. > > Reviewed-by: Mohamed Mediouni > Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/5052 > Link: https://lore.kernel.org/qemu-devel/20261130221153.1182504-1-pierrick.bouvier@oss.qualcomm.com > Signed-off-by: Pierrick Bouvier > --- > include/system/os-win32.h | 14 ++++++++------ > meson.build | 6 +++--- > 2 files changed, 11 insertions(+), 9 deletions(-) > > diff --git a/include/system/os-win32.h b/include/system/os-win32.h > index 22d72babdf4..f3896763cdd 100644 > --- a/include/system/os-win32.h > +++ b/include/system/os-win32.h > @@ -56,19 +56,21 @@ extern "C" { > /* > * On windows-arm64, setjmp is available in only one variant, and longjmp always > * does stack unwinding. This crash with generated code. > - * Thus, we use another implementation of setjmp (not windows one), coming from > + * Thus, we use another implementation of longjmp (not windows one), coming from > * mingw, which never performs stack unwinding. > + * > + * mingw used to provide __mingw_setjmp, but it was removed in favor of > + * _setjmpex(env, NULL): > + * https://github.com/mingw-w64/mingw-w64/commit/326b51ef75c4dde099edb063a573b7d114a93af1 > */ > #undef setjmp > #undef longjmp > /* > - * These functions are not declared in setjmp.h because __aarch64__ defines > - * setjmp to _setjmpex instead. However, they are still defined in libmingwex.a, > - * which gets linked automatically. > + * __mingw_longjmp is not always declared in setjmp.h, but it is defined in > + * libmingwex.a, which gets linked automatically. > */ > -int __mingw_setjmp(jmp_buf); > void __attribute__((noreturn)) __mingw_longjmp(jmp_buf, int); > -#define setjmp(env) __mingw_setjmp(env) > +#define setjmp(env) _setjmpex(env, NULL) > #define longjmp(env, val) __mingw_longjmp(env, val) > #elif defined(_WIN64) > /* > diff --git a/meson.build b/meson.build > index f8dd3926dd8..35e10d8cf10 100644 > --- a/meson.build > +++ b/meson.build > @@ -3209,15 +3209,15 @@ endif > if host_os == 'windows' > mingw_has_setjmp_longjmp = cc.links(''' > #include > + #include > int main(void) { > /* > - * These functions are not available in setjmp header, but may be > + * __mingw_longjmp is not always declared in setjmp header, but may be > * available at link time, from libmingwex.a. > */ > - extern int __mingw_setjmp(jmp_buf); > extern void __attribute__((noreturn)) __mingw_longjmp(jmp_buf, int); > jmp_buf env; > - __mingw_setjmp(env); > + _setjmpex(env, NULL); > __mingw_longjmp(env, 0); Is it really a good idea to mix interfaces like this? Surely _setjmpex should be paired with _longjmpex. r~