Update LLVM from 21 to 22 (#505)

This commit is contained in:
kvpanch authored and GitHub committed 2026-04-28 14:28:14 -04:00
1 parent 72d47e4d26
commit 8326aa3aed
49 files changed
+182 -181

No files matched your search

+11 -2
View File
@@ -9,6 +9,8 @@ fn set_rustc_link_flags() {
llvm_lib_path.to_string_lossy()
);
let llvm_built_with_libcxx = llvm_lib_path.join("libc++.a").exists();
for lib in [
// These are required by ld.lld
"lldELF",
@@ -96,15 +98,22 @@ fn set_rustc_link_flags() {
"LLVMVectorize",
"LLVMSandboxIR",
"LLVMExtensions",
"LLVMDTLTO",
"LLVMPlugins",
"LLVMFrontendHLSL",
] {
println!("cargo:rustc-link-lib=static={lib}");
}
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
let target_env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap_or_default();
if target_os == "linux" {
if target_env == "musl" {
if llvm_built_with_libcxx {
// LLVM archives reference `std::__1::…` and unwinder symbols that
// `libstdc++` does not provide; pull them from the LLVM prefix.
println!("cargo:rustc-link-lib=static=c++");
if llvm_lib_path.join("libunwind.a").exists() {
println!("cargo:rustc-link-lib=static=unwind");
}
} else {
println!("cargo:rustc-link-lib=dylib=stdc++");
}