From 94dd9c26dde429f9ac7dee9dce27bc7716f3ee63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 3 Feb 2022 17:54:52 +0100 Subject: [PATCH] Server: Fix skip libstdc++ static linking on macOS Fixes #48161. --- platform/server/detect.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/platform/server/detect.py b/platform/server/detect.py index 191034073b8..6fa838df17d 100644 --- a/platform/server/detect.py +++ b/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"])