ondk/patches/patch_llvm_build.patch
2025-03-16 16:19:07 -07:00

33 lines
1.5 KiB
Diff

diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs
index be5b4057..da2b5054 100644
--- a/src/bootstrap/src/core/build_steps/llvm.rs
+++ b/src/bootstrap/src/core/build_steps/llvm.rs
@@ -308,7 +308,7 @@ fn run(self, builder: &Builder<'_>) -> LlvmResult {
LlvmBuildStatus::ShouldBuild(m) => m,
};
- if builder.llvm_link_shared() && target.is_windows() {
+ if builder.llvm_link_shared() && target.is_msvc() {
panic!("shared linking to LLVM is not currently supported on {}", target.triple);
}
@@ -463,6 +463,9 @@ fn run(self, builder: &Builder<'_>) -> LlvmResult {
enabled_llvm_projects.push("clang");
}
+ // ONDK change: always enable lld
+ enabled_llvm_projects.push("lld");
+
// We want libxml to be disabled.
// See https://github.com/rust-lang/rust/pull/50104
cfg.define("LLVM_ENABLE_LIBXML2", "OFF");
@@ -567,7 +570,7 @@ fn run(self, builder: &Builder<'_>) -> LlvmResult {
// link to make llvm-config happy.
if builder.llvm_link_shared() && target.contains("apple-darwin") {
let lib_name = find_llvm_lib_name("dylib");
- let lib_llvm = out_dir.join("build").join("lib").join(lib_name);
+ let lib_llvm = out_dir.join("lib").join(lib_name);
if !lib_llvm.exists() {
t!(builder.symlink_file("libLLVM.dylib", &lib_llvm));
}