Update llvm.rs

This commit is contained in:
Dirreck 2023-08-13 19:23:22 +08:00 committed by dirreke
parent c0f20413f4
commit 712f448168

View File

@ -374,28 +374,13 @@ impl Step for Llvm {
cfg.define("LLVM_LINK_LLVM_DYLIB", "ON");
}
if target.starts_with("riscv")
if (target.starts_with("riscv")
|| target.starts_with("csky"))
&& !target.contains("freebsd")
&& !target.contains("openbsd")
&& !target.contains("netbsd")
{
// RISC-V GCC erroneously requires linking against
// `libatomic` when using 1-byte and 2-byte C++
// atomics but the LLVM build system check cannot
// detect this. Therefore it is set manually here.
// Some BSD uses Clang as its system compiler and
// provides no libatomic in its base system so does
// not want this.
ldflags.exe.push(" -latomic");
ldflags.shared.push(" -latomic");
}
if target.starts_with("csky")
&& !target.contains("freebsd")
&& !target.contains("openbsd")
&& !target.contains("netbsd")
{
// CSKY GCC erroneously requires linking against
// RISC-V and CSKY GCC erroneously requires linking against
// `libatomic` when using 1-byte and 2-byte C++
// atomics but the LLVM build system check cannot
// detect this. Therefore it is set manually here.