浏览代码

Server: Fix skip libstdc++ static linking on macOS

Fixes #48161.

(cherry picked from commit 94dd9c26dde429f9ac7dee9dce27bc7716f3ee63)
Rémi Verschelde 3 年之前
父节点
当前提交
269c585f08
共有 1 个文件被更改,包括 9 次插入3 次删除
  1. 9 3
      platform/server/detect.py

+ 9 - 3
platform/server/detect.py

@@ -259,6 +259,12 @@ def configure(env):
     if env["execinfo"]:
         env.Append(LIBS=["execinfo"])
 
-    # Link those statically for portability
-    if env["use_static_cpp"]:
-        env.Append(LINKFLAGS=["-static-libgcc", "-static-libstdc++"])
+    if platform.system() != "Darwin":
+        # Link those statically for portability
+        if env["use_static_cpp"]:
+            env.Append(LINKFLAGS=["-static-libgcc", "-static-libstdc++"])
+            if env["use_llvm"] and platform.system() != "FreeBSD":
+                env["LINKCOM"] = env["LINKCOM"] + " -l:libatomic.a"
+        else:
+            if env["use_llvm"] and platform.system() != "FreeBSD":
+                env.Append(LIBS=["atomic"])