Rollup merge of #114224 - inferiorhumanorgans:solaris-llvm-wrapper, r=cuviper

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
This commit is contained in:
Matthias Krüger 2023-11-13 21:28:54 +01:00 committed by GitHub
commit 03d6e7ade0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -242,6 +242,12 @@ fn main() {
cmd.arg("--system-libs"); cmd.arg("--system-libs");
} }
// We need libkstat for getHostCPUName on SPARC builds.
// See also: https://github.com/llvm/llvm-project/issues/64186
if target.starts_with("sparcv9") && target.contains("solaris") {
println!("cargo:rustc-link-lib=kstat");
}
if (target.starts_with("arm") && !target.contains("freebsd")) if (target.starts_with("arm") && !target.contains("freebsd"))
|| target.starts_with("mips-") || target.starts_with("mips-")
|| target.starts_with("mipsel-") || target.starts_with("mipsel-")