From 51223a12cbcb8ee72e7519112cf9bc21df9d0170 Mon Sep 17 00:00:00 2001 From: Tim Gymnich Date: Fri, 2 Aug 2024 02:59:43 +0200 Subject: [PATCH 1/4] fix enzyme library used for build --- src/bootstrap/src/core/build_steps/llvm.rs | 2 +- src/bootstrap/src/core/builder.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs index 57f15faca1315..9c3e40913187f 100644 --- a/src/bootstrap/src/core/build_steps/llvm.rs +++ b/src/bootstrap/src/core/build_steps/llvm.rs @@ -894,7 +894,7 @@ impl Step for Enzyme { .profile(profile) .env("LLVM_CONFIG_REAL", &llvm_config) .define("LLVM_ENABLE_ASSERTIONS", "ON") - .define("ENZYME_EXTERNAL_SHARED_LIB", "OFF") + .define("ENZYME_EXTERNAL_SHARED_LIB", "ON") .define("LLVM_DIR", &llvm_cmake_dir); cfg.build(); diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs index eb028c367d797..e7d02653baf78 100644 --- a/src/bootstrap/src/core/builder.rs +++ b/src/bootstrap/src/core/builder.rs @@ -1419,7 +1419,7 @@ impl<'a> Builder<'a> { // https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/.E2.9C.94.20link.20new.20library.20into.20stage1.2Frustc if self.config.llvm_enzyme { rustflags.arg("-l"); - rustflags.arg("LLVMEnzyme-17"); + rustflags.arg("Enzyme-17"); } let use_new_symbol_mangling = match self.config.rust_new_symbol_mangling { From 3da1c14987f144c23ac6900fb5893da91e8cb64c Mon Sep 17 00:00:00 2001 From: Tim Gymnich Date: Fri, 2 Aug 2024 03:45:23 +0200 Subject: [PATCH 2/4] test --- src/bootstrap/src/core/builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs index e7d02653baf78..eb028c367d797 100644 --- a/src/bootstrap/src/core/builder.rs +++ b/src/bootstrap/src/core/builder.rs @@ -1419,7 +1419,7 @@ impl<'a> Builder<'a> { // https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/.E2.9C.94.20link.20new.20library.20into.20stage1.2Frustc if self.config.llvm_enzyme { rustflags.arg("-l"); - rustflags.arg("Enzyme-17"); + rustflags.arg("LLVMEnzyme-17"); } let use_new_symbol_mangling = match self.config.rust_new_symbol_mangling { From 7f472afc05b476f7b7cb777cb7bcadab283d1ac4 Mon Sep 17 00:00:00 2001 From: Tim Gymnich Date: Fri, 2 Aug 2024 04:06:44 +0200 Subject: [PATCH 3/4] Revert "test" This reverts commit 3da1c14987f144c23ac6900fb5893da91e8cb64c. --- src/bootstrap/src/core/builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs index eb028c367d797..e7d02653baf78 100644 --- a/src/bootstrap/src/core/builder.rs +++ b/src/bootstrap/src/core/builder.rs @@ -1419,7 +1419,7 @@ impl<'a> Builder<'a> { // https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/.E2.9C.94.20link.20new.20library.20into.20stage1.2Frustc if self.config.llvm_enzyme { rustflags.arg("-l"); - rustflags.arg("LLVMEnzyme-17"); + rustflags.arg("Enzyme-17"); } let use_new_symbol_mangling = match self.config.rust_new_symbol_mangling { From 7075807c3993d089f35a79bdd9281b82843bfcb1 Mon Sep 17 00:00:00 2001 From: Tim Gymnich Date: Fri, 2 Aug 2024 13:49:36 +0200 Subject: [PATCH 4/4] more fixes --- src/bootstrap/src/core/build_steps/compile.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index cdb798c47d571..ed2435d694df7 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -1648,12 +1648,12 @@ impl Step for Assemble { }; if let Some(enzyme_install) = enzyme_install { - let src_lib = enzyme_install.join("build/Enzyme/LLVMEnzyme-17.so"); + let src_lib = enzyme_install.join("build/Enzyme/libEnzyme-17.so"); let libdir = builder.sysroot_libdir(build_compiler, build_compiler.host); let target_libdir = builder.sysroot_libdir(target_compiler, target_compiler.host); - let dst_lib = libdir.join("libLLVMEnzyme-17.so"); - let target_dst_lib = target_libdir.join("libLLVMEnzyme-17.so"); + let dst_lib = libdir.join("libEnzyme-17.so"); + let target_dst_lib = target_libdir.join("libEnzyme-17.so"); builder.copy(&src_lib, &dst_lib); builder.copy(&src_lib, &target_dst_lib); }