commit c41de3cb5bd2b6fb243e10b150b705435d2db63c
Author: Alex Hochheiden <ahochheiden@mozilla.com>
Date:   Wed Apr 1 18:11:37 2026 +0000

    Bug 2023597 - Use `wasm32-wasip1` target for clang >= 22.1 r=firefox-build-system-reviewers,sergesanspaille
    
    https://github.com/llvm/llvm-project/pull/165345
    https://releases.llvm.org/22.1.0/tools/clang/docs/ReleaseNotes.html
    
    Differential Revision: https://phabricator.services.mozilla.com/D291023

diff --git build/moz.configure/toolchain.configure build/moz.configure/toolchain.configure
index 10d715866b1f..4b07f9d7a8de 100644
--- build/moz.configure/toolchain.configure
+++ build/moz.configure/toolchain.configure
@@ -695,6 +695,9 @@ def check_compiler(configure_cache, compiler, language, target, android_version)
         # This makes clang define __ANDROID_API__ and use versioned library
         # directories from the NDK.
         toolchain = "%s%d" % (target.toolchain, android_version)
+    elif target.kernel == "WASI" and info.type == "clang" and info.version >= Version("22.1"):
+        # The wasm32-wasi target was renamed to wasm32-wasip1 in LLVM 22.1.
+        toolchain = "wasm32-wasip1"
     else:
         toolchain = target.toolchain
 
