[clang] [lld] [llvm] [lld][WebAssembly] WASIP3 and component model threading support (PR #175800)

Sam Clegg via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 17 09:18:17 PST 2026


================
@@ -160,9 +168,17 @@ void wasm::Linker::ConstructJob(Compilation &C, const JobAction &JA,
 
   AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
 
-  if (WantsPthread(ToolChain.getTriple(), Args))
+  if (WantsSharedMemory(ToolChain.getTriple(), Args))
     CmdArgs.push_back("--shared-memory");
 
+  // Enable component model thread context by default for wasip3
+  bool DefaultComponentModelThreadContext =
+      ToolChain.getTriple().getOSName() == "wasip3";
+  if (Args.hasFlag(options::OPT_mcomponent_model_thread_context,
+                   options::OPT_mno_component_model_thread_context,
+                   DefaultComponentModelThreadContext))
----------------
sbc100 wrote:

Can we just use `HasComponentModelThreadContext` here ?   (i.e. isn't HasComponentModelThreadContext already set according the command line flags already)

https://github.com/llvm/llvm-project/pull/175800


More information about the cfe-commits mailing list