llvm-toolchain/debian/patches/wasm/wasm-ld-path.diff
2024-03-19 09:51:11 +01:00

26 lines
1.0 KiB
Diff

Index: llvm-toolchain-snapshot_19~++20240319094628+703920d4138d/clang/lib/Driver/ToolChains/WebAssembly.cpp
===================================================================
--- llvm-toolchain-snapshot_19~++20240319094628+703920d4138d.orig/clang/lib/Driver/ToolChains/WebAssembly.cpp
+++ llvm-toolchain-snapshot_19~++20240319094628+703920d4138d/clang/lib/Driver/ToolChains/WebAssembly.cpp
@@ -20,6 +20,11 @@
#include "llvm/Support/Path.h"
#include "llvm/Support/VirtualFileSystem.h"
+#include "llvm/Config/llvm-config.h" // for LLVM_VERSION_MAJOR
+
+#define TOSTR2(X) #X
+#define TOSTR(X) TOSTR2(X)
+
using namespace clang::driver;
using namespace clang::driver::tools;
using namespace clang::driver::toolchains;
@@ -241,7 +246,7 @@ WebAssembly::WebAssembly(const Driver &D
const char *WebAssembly::getDefaultLinker() const {
if (getOS() == "wasip2")
return "wasm-component-ld";
- return "wasm-ld";
+ return "wasm-ld-" TOSTR(LLVM_VERSION_MAJOR);
}
bool WebAssembly::IsMathErrnoDefault() const { return false; }