From 8f7175c199472486756ab4432addc416e548e6d6 Mon Sep 17 00:00:00 2001 From: John Paul Adrian Glaubitz Date: Mon, 24 Jun 2024 16:41:35 +0200 Subject: [PATCH] bootstrap: Link against libatomic on 32-bit SPARC While at it, order the list of architectures alphabetically. --- src/bootstrap/src/core/build_steps/llvm.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs index 8b379d3be5c..8e6795b11bd 100644 --- a/src/bootstrap/src/core/build_steps/llvm.rs +++ b/src/bootstrap/src/core/build_steps/llvm.rs @@ -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"); }