about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorDirreke <mingyang_ge@163.com>2023-07-19 22:33:34 +0800
committerdirreke <mingyang_ge@163.com>2023-08-14 23:02:37 +0800
commit184a9afffbc7ba23409ca071d86b34ad74f50b17 (patch)
tree0b008142c5a10f172692beab241a0cbd5b724a8a /src/bootstrap
parent9e5fb333f7b392ab28f51641c00270e82b84d607 (diff)
add details for csky-unknown-linux-gnuabiv2 and add docs
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/llvm.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/bootstrap/llvm.rs b/src/bootstrap/llvm.rs
index 7acf657f630..da7ff626cb2 100644
--- a/src/bootstrap/llvm.rs
+++ b/src/bootstrap/llvm.rs
@@ -390,6 +390,22 @@ impl Step for Llvm {
             ldflags.shared.push(" -latomic");
         }
 
+        if target.starts_with("csky")
+            && !target.contains("freebsd")
+            && !target.contains("openbsd")
+            && !target.contains("netbsd")
+        {
+            // 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.
+            // 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.contains("msvc") {
             cfg.define("LLVM_USE_CRT_DEBUG", "MT");
             cfg.define("LLVM_USE_CRT_RELEASE", "MT");