浏览代码

Merge pull request #46347 from hpvb/static-link-atomic-clang

Allow static linking with libatomic using clang
Hein-Pieter van Braam 4 年之前
父节点
当前提交
50d71e7f2a
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      platform/linuxbsd/detect.py

+ 6 - 1
platform/linuxbsd/detect.py

@@ -127,7 +127,6 @@ def configure(env):
             env["CC"] = "clang"
             env["CXX"] = "clang++"
         env.extra_suffix = ".llvm" + env.extra_suffix
-        env.Append(LIBS=["atomic"])
 
     if env["use_lld"]:
         if env["use_llvm"]:
@@ -394,3 +393,9 @@ def configure(env):
         # That doesn't make any sense but it's likely a Ubuntu bug?
         if is64 or env["bits"] == "64":
             env.Append(LINKFLAGS=["-static-libgcc", "-static-libstdc++"])
+        if env["use_llvm"]:
+            env["LINKCOM"] = env["LINKCOM"] + " -l:libatomic.a"
+
+    else:
+        if env["use_llvm"]:
+            env.Append(LIBS=["atomic"])