llvm-toolchain/debian/patches/wasm/wasm-compiler-rt-default.diff
2024-02-20 12:51:51 +01:00

36 lines
1.8 KiB
Diff

Index: llvm-toolchain-snapshot_19~++20240220124703+f122268c0441/clang/lib/Driver/ToolChains/WebAssembly.cpp
===================================================================
--- llvm-toolchain-snapshot_19~++20240220124703+f122268c0441.orig/clang/lib/Driver/ToolChains/WebAssembly.cpp
+++ llvm-toolchain-snapshot_19~++20240220124703+f122268c0441/clang/lib/Driver/ToolChains/WebAssembly.cpp
@@ -393,6 +393,18 @@ ToolChain::RuntimeLibType WebAssembly::G
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: llvm-toolchain-snapshot_19~++20240220124703+f122268c0441/clang/lib/Driver/ToolChains/WebAssembly.h
===================================================================
--- llvm-toolchain-snapshot_19~++20240220124703+f122268c0441.orig/clang/lib/Driver/ToolChains/WebAssembly.h
+++ llvm-toolchain-snapshot_19~++20240220124703+f122268c0441/clang/lib/Driver/ToolChains/WebAssembly.h
@@ -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,