Skip to content

Commit 103b2df

Browse files
author
Alex Zepeda
committed
rustc_llvm: Link to libkstat on Solaris/SPARC
getHostCPUName calls into libkstat but as of LLVM 16.0.6 libLLVMTargetParser is not explicitly linked against libkstat causing builds to fail due to undefined symbols. See also: llvm/llvm-project#64186
1 parent 03a5725 commit 103b2df

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_llvm/build.rs

+5
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,11 @@ fn main() {
241241
cmd.arg("--system-libs");
242242
}
243243

244+
// We need libkstat for getHostCPUName on SPARC builds.
245+
if target.starts_with("sparcv9") && target.contains("solaris") {
246+
println!("cargo:rustc-link-lib=kstat");
247+
}
248+
244249
if (target.starts_with("arm") && !target.contains("freebsd"))
245250
|| target.starts_with("mips-")
246251
|| target.starts_with("mipsel-")

0 commit comments

Comments
 (0)