wasm-compiler-rt-default
authorLLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
Sat, 4 May 2024 05:30:47 +0000 (07:30 +0200)
committerGianfranco Costamagna <locutusofborg@debian.org>
Sat, 4 May 2024 05:30:47 +0000 (07:30 +0200)
Gbp-Pq: Topic wasm
Gbp-Pq: Name wasm-compiler-rt-default.diff

clang/lib/Driver/ToolChains/WebAssembly.cpp
clang/lib/Driver/ToolChains/WebAssembly.h

index 2098a68cbc6e5678fc82e43768937f363c362c43..4328d5e5627e0907917671e1b2c8318acfcb2484 100644 (file)
@@ -382,6 +382,18 @@ ToolChain::RuntimeLibType WebAssembly::GetDefaultRuntimeLibType() const {
   return ToolChain::RLT_CompilerRT;
 }
 
+ToolChain::RuntimeLibType WebAssembly::GetRuntimeLibType(
+    const ArgList &Args) const {
+  if (Arg *A = Args.getLastArg(options::OPT_rtlib_EQ)) {
+    StringRef Value = A->getValue();
+    if (Value != "compiler-rt")
+      getDriver().Diag(clang::diag::err_drv_unsupported_rtlib_for_platform)
+          << Value << "WebAssembly";
+  }
+
+  return ToolChain::RLT_CompilerRT;
+}
+
 ToolChain::CXXStdlibType
 WebAssembly::GetCXXStdlibType(const ArgList &Args) const {
   if (Arg *A = Args.getLastArg(options::OPT_stdlib_EQ)) {
index 56ec9e0935837e91911e8271040cfaaa8959a583..479889be20f0e87b3f4287004be3d46aa71d356d 100644 (file)
@@ -60,6 +60,7 @@ private:
                         llvm::opt::ArgStringList &CC1Args,
                         Action::OffloadKind DeviceOffloadKind) const override;
   RuntimeLibType GetDefaultRuntimeLibType() const override;
+  RuntimeLibType GetRuntimeLibType(const llvm::opt::ArgList &Args) const override;
   CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
   void
   AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,