Skip to content

Commit

Permalink
Auto merge of rust-lang#121395 - nikic:update-llvm-21, r=<try>
Browse files Browse the repository at this point in the history
Update to LLVM 18.1.0 rc 3

Fixes rust-lang#120819.
Fixes rust-lang#121180.
Fixes rust-lang#121239.
Fixes rust-lang#121367.
  • Loading branch information
bors committed Feb 24, 2024
2 parents 8f359be + 2e45899 commit 7c9bfbe
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
shallow = true
[submodule "src/llvm-project"]
path = src/llvm-project
url = https://github.com/rust-lang/llvm-project.git
branch = rustc/18.0-2024-02-13
url = https://github.com/nikic/llvm-project.git
branch = rust-shlib-cherry-pick
shallow = true
[submodule "src/doc/embedded-book"]
path = src/doc/embedded-book
Expand Down
11 changes: 10 additions & 1 deletion src/bootstrap/src/core/build_steps/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2026,7 +2026,16 @@ fn install_llvm_file(builder: &Builder<'_>, source: &Path, destination: &Path) {
return;
}

builder.install(source, destination, 0o644);
if source.is_symlink() {
// If we have a symlink like libLLVM-18.so -> libLLVM.so.18.1, install both the target
// and the symlink. The target is what will get loaded at runtime. The symlink is what
// will be used for linking when download-ci-llvm is used.
builder.install(&t!(fs::canonicalize(source)), destination, 0o644);
let full_dest = destination.join(source.file_name().unwrap());
builder.copy(&source, &full_dest);
} else {
builder.install(&source, destination, 0o644);
}
}

/// Maybe add LLVM object files to the given destination lib-dir. Allows either static or dynamic linking.
Expand Down
3 changes: 0 additions & 3 deletions src/bootstrap/src/core/build_steps/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ pub fn prebuilt_llvm_config(
let out_dir = builder.llvm_out(target);

let mut llvm_config_ret_dir = builder.llvm_out(builder.config.build);
if (!builder.config.build.is_msvc() || builder.ninja()) && !builder.config.llvm_from_ci {
llvm_config_ret_dir.push("build");
}
llvm_config_ret_dir.push("bin");
let build_llvm_config = llvm_config_ret_dir.join(exe("llvm-config", builder.config.build));
let llvm_cmake_dir = out_dir.join("lib/cmake/llvm");
Expand Down
2 changes: 1 addition & 1 deletion src/llvm-project
Submodule llvm-project updated 165 files
3 changes: 2 additions & 1 deletion src/tools/opt-dist/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ fn execute_pipeline(
})?;

let libdir = env.build_artifacts().join("stage2").join("lib");
let llvm_lib = io::find_file_in_dir(&libdir, "libLLVM", ".so")?;
// The actual name will be something like libLLVM.so.18.1-rust-dev.
let llvm_lib = io::find_file_in_dir(&libdir, "libLLVM.so", "")?;

log::info!("Optimizing {llvm_lib} with BOLT");

Expand Down

0 comments on commit 7c9bfbe

Please sign in to comment.