bootstrap: Link against libatomic on 32-bit SPARC

While at it, order the list of architectures alphabetically.
This commit is contained in:
John Paul Adrian Glaubitz 2024-06-24 16:41:35 +02:00
parent dc8ac3ec91
commit 8f7175c199

View File

@ -407,18 +407,21 @@ fn run(self, builder: &Builder<'_>) -> LlvmResult {
cfg.define("LLVM_LINK_LLVM_DYLIB", "ON");
}
if (target.starts_with("riscv") || target.starts_with("csky"))
if (target.starts_with("csky")
|| target.starts_with("riscv")
|| target.starts_with("sparc-"))
&& !target.contains("freebsd")
&& !target.contains("openbsd")
&& !target.contains("netbsd")
{
// RISC-V and CSKY GCC erroneously requires linking against
// CSKY and 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.
// not want this. 32-bit SPARC requires linking against
// libatomic as well.
ldflags.exe.push(" -latomic");
ldflags.shared.push(" -latomic");
}