Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/platform/linuxbsd/detect.py
11351 views
1
import os
2
import platform
3
import sys
4
from typing import TYPE_CHECKING
5
6
from methods import get_compiler_version, print_error, print_info, print_warning, using_gcc
7
from platform_methods import detect_arch, validate_arch
8
9
if TYPE_CHECKING:
10
from SCons.Script.SConscript import SConsEnvironment
11
12
13
def get_name():
14
return "LinuxBSD"
15
16
17
def can_build():
18
if os.name != "posix" or sys.platform == "darwin":
19
return False
20
21
pkgconf_error = os.system("pkg-config --version > /dev/null")
22
if pkgconf_error:
23
print_error("pkg-config not found. Aborting.")
24
return False
25
26
return True
27
28
29
def get_opts():
30
from SCons.Variables import BoolVariable, EnumVariable
31
32
return [
33
EnumVariable("linker", "Linker program", "default", ["default", "bfd", "gold", "lld", "mold"], ignorecase=2),
34
BoolVariable("use_llvm", "Use the LLVM compiler", False),
35
BoolVariable("use_static_cpp", "Link libgcc and libstdc++ statically for better portability", True),
36
BoolVariable("use_coverage", "Test Godot coverage", False),
37
BoolVariable("use_ubsan", "Use LLVM/GCC compiler undefined behavior sanitizer (UBSAN)", False),
38
BoolVariable("use_asan", "Use LLVM/GCC compiler address sanitizer (ASAN)", False),
39
BoolVariable("use_lsan", "Use LLVM/GCC compiler leak sanitizer (LSAN)", False),
40
BoolVariable("use_tsan", "Use LLVM/GCC compiler thread sanitizer (TSAN)", False),
41
BoolVariable("use_msan", "Use LLVM compiler memory sanitizer (MSAN)", False),
42
BoolVariable("use_sowrap", "Dynamically load system libraries", True),
43
BoolVariable("alsa", "Use ALSA", True),
44
BoolVariable("pulseaudio", "Use PulseAudio", True),
45
BoolVariable("dbus", "Use D-Bus to handle screensaver and portal desktop settings", True),
46
BoolVariable("speechd", "Use Speech Dispatcher for Text-to-Speech support", True),
47
BoolVariable("fontconfig", "Use fontconfig for system fonts support", True),
48
BoolVariable("udev", "Use udev for gamepad connection callbacks", True),
49
BoolVariable("x11", "Enable X11 display", True),
50
BoolVariable("wayland", "Enable Wayland display", True),
51
BoolVariable("libdecor", "Enable libdecor support", True),
52
BoolVariable("touch", "Enable touch events", True),
53
BoolVariable("execinfo", "Use libexecinfo on systems where glibc is not available", False),
54
]
55
56
57
def get_doc_classes():
58
return [
59
"EditorExportPlatformLinuxBSD",
60
]
61
62
63
def get_doc_path():
64
return "doc_classes"
65
66
67
def get_flags():
68
return {
69
"arch": detect_arch(),
70
"supported": ["mono"],
71
}
72
73
74
def configure(env: "SConsEnvironment"):
75
# Validate arch.
76
supported_arches = ["x86_32", "x86_64", "arm32", "arm64", "rv64", "ppc64", "loongarch64"]
77
validate_arch(env["arch"], get_name(), supported_arches)
78
79
## Build type
80
81
if env.dev_build:
82
# This is needed for our crash handler to work properly.
83
# gdb works fine without it though, so maybe our crash handler could too.
84
env.Append(LINKFLAGS=["-rdynamic"])
85
86
# Cross-compilation
87
# TODO: Support cross-compilation on architectures other than x86.
88
host_is_64_bit = sys.maxsize > 2**32
89
if host_is_64_bit and env["arch"] == "x86_32":
90
env.Append(CCFLAGS=["-m32"])
91
env.Append(LINKFLAGS=["-m32"])
92
elif not host_is_64_bit and env["arch"] == "x86_64":
93
env.Append(CCFLAGS=["-m64"])
94
env.Append(LINKFLAGS=["-m64"])
95
96
# CPU architecture flags.
97
if env["arch"] == "rv64":
98
# G = General-purpose extensions, C = Compression extension (very common).
99
env.Append(CCFLAGS=["-march=rv64gc"])
100
101
## Compiler configuration
102
103
if "CXX" in env and "clang" in os.path.basename(env["CXX"]):
104
# Convenience check to enforce the use_llvm overrides when CXX is clang(++)
105
env["use_llvm"] = True
106
107
if env["use_llvm"]:
108
if "clang++" not in os.path.basename(env["CXX"]):
109
env["CC"] = "clang"
110
env["CXX"] = "clang++"
111
env.extra_suffix = ".llvm" + env.extra_suffix
112
113
if env["linker"] != "default":
114
print("Using linker program: " + env["linker"])
115
if env["linker"] == "mold" and using_gcc(env): # GCC < 12.1 doesn't support -fuse-ld=mold.
116
cc_version = get_compiler_version(env)
117
cc_semver = (cc_version["major"], cc_version["minor"])
118
if cc_semver < (12, 1):
119
found_wrapper = False
120
for path in ["/usr/libexec", "/usr/local/libexec", "/usr/lib", "/usr/local/lib"]:
121
if os.path.isfile(path + "/mold/ld"):
122
env.Append(LINKFLAGS=["-B" + path + "/mold"])
123
found_wrapper = True
124
break
125
if not found_wrapper:
126
for path in os.environ["PATH"].split(os.pathsep):
127
if os.path.isfile(path + "/ld.mold"):
128
env.Append(LINKFLAGS=["-B" + path])
129
found_wrapper = True
130
break
131
if not found_wrapper:
132
print_error(
133
"Couldn't locate mold installation path. Make sure it's installed in /usr, /usr/local or in PATH environment variable."
134
)
135
sys.exit(255)
136
else:
137
env.Append(LINKFLAGS=["-fuse-ld=mold"])
138
else:
139
env.Append(LINKFLAGS=["-fuse-ld=%s" % env["linker"]])
140
141
if env["use_coverage"]:
142
env.Append(CCFLAGS=["-ftest-coverage", "-fprofile-arcs"])
143
env.Append(LINKFLAGS=["-ftest-coverage", "-fprofile-arcs"])
144
145
if env["use_ubsan"] or env["use_asan"] or env["use_lsan"] or env["use_tsan"] or env["use_msan"]:
146
env.extra_suffix += ".san"
147
env.Append(CPPDEFINES=["SANITIZERS_ENABLED"])
148
149
if env["use_ubsan"]:
150
env.Append(
151
CCFLAGS=[
152
"-fsanitize=undefined,shift,shift-exponent,integer-divide-by-zero,unreachable,vla-bound,null,return,signed-integer-overflow,bounds,float-divide-by-zero,float-cast-overflow,nonnull-attribute,returns-nonnull-attribute,bool,enum,vptr,pointer-overflow,builtin"
153
]
154
)
155
env.Append(LINKFLAGS=["-fsanitize=undefined"])
156
if env["use_llvm"]:
157
env.Append(
158
CCFLAGS=[
159
"-fsanitize=nullability-return,nullability-arg,function,nullability-assign,implicit-integer-sign-change"
160
]
161
)
162
else:
163
env.Append(CCFLAGS=["-fsanitize=bounds-strict"])
164
165
if env["use_asan"]:
166
env.Append(CCFLAGS=["-fsanitize=address,pointer-subtract,pointer-compare"])
167
env.Append(LINKFLAGS=["-fsanitize=address"])
168
169
if env["use_lsan"]:
170
env.Append(CCFLAGS=["-fsanitize=leak"])
171
env.Append(LINKFLAGS=["-fsanitize=leak"])
172
173
if env["use_tsan"]:
174
env.Append(CCFLAGS=["-fsanitize=thread"])
175
env.Append(LINKFLAGS=["-fsanitize=thread"])
176
177
if env["use_msan"] and env["use_llvm"]:
178
env.Append(CCFLAGS=["-fsanitize=memory"])
179
env.Append(CCFLAGS=["-fsanitize-memory-track-origins"])
180
env.Append(CCFLAGS=["-fsanitize-recover=memory"])
181
env.Append(LINKFLAGS=["-fsanitize=memory"])
182
183
env.Append(CCFLAGS=["-ffp-contract=off"])
184
185
# LTO
186
187
if env["lto"] == "auto": # Enable LTO for production.
188
env["lto"] = "thin" if env["use_llvm"] else "full"
189
190
if env["lto"] != "none":
191
if env["lto"] == "thin":
192
if not env["use_llvm"]:
193
print_error("ThinLTO is only compatible with LLVM, use `use_llvm=yes` or `lto=full`.")
194
sys.exit(255)
195
env.Append(CCFLAGS=["-flto=thin"])
196
env.Append(LINKFLAGS=["-flto=thin"])
197
elif not env["use_llvm"] and env.GetOption("num_jobs") > 1:
198
env.Append(CCFLAGS=["-flto"])
199
env.Append(LINKFLAGS=["-flto=" + str(env.GetOption("num_jobs"))])
200
else:
201
env.Append(CCFLAGS=["-flto"])
202
env.Append(LINKFLAGS=["-flto"])
203
204
if not env["use_llvm"]:
205
env["RANLIB"] = "gcc-ranlib"
206
env["AR"] = "gcc-ar"
207
208
env.Append(CCFLAGS=["-pipe"])
209
210
## Dependencies
211
212
if env["use_sowrap"]:
213
env.Append(CPPDEFINES=["SOWRAP_ENABLED"])
214
215
if env["wayland"]:
216
if os.system("wayland-scanner -v 2>/dev/null") != 0:
217
print_warning("wayland-scanner not found. Disabling Wayland support.")
218
env["wayland"] = False
219
220
if env["touch"]:
221
env.Append(CPPDEFINES=["TOUCH_ENABLED"])
222
223
# FIXME: Check for existence of the libs before parsing their flags with pkg-config
224
225
if not env["builtin_freetype"]:
226
env.ParseConfig("pkg-config freetype2 --cflags --libs")
227
228
if not env["builtin_graphite"]:
229
env.ParseConfig("pkg-config graphite2 --cflags --libs")
230
231
if not env["builtin_icu4c"]:
232
env.ParseConfig("pkg-config icu-i18n icu-uc --cflags --libs")
233
234
if not env["builtin_harfbuzz"]:
235
env.ParseConfig("pkg-config harfbuzz harfbuzz-icu --cflags --libs")
236
237
if not env["builtin_icu4c"] or not env["builtin_harfbuzz"]:
238
print_warning(
239
"System-provided icu4c or harfbuzz cause known issues for GDExtension (see GH-91401 and GH-100301)."
240
)
241
242
if not env["builtin_libpng"]:
243
env.ParseConfig("pkg-config libpng16 --cflags --libs")
244
245
if not env["builtin_enet"]:
246
env.ParseConfig("pkg-config libenet --cflags --libs")
247
248
if not env["builtin_zstd"]:
249
env.ParseConfig("pkg-config libzstd --cflags --libs")
250
251
if env["brotli"] and not env["builtin_brotli"]:
252
env.ParseConfig("pkg-config libbrotlicommon libbrotlidec --cflags --libs")
253
254
# Sound and video libraries
255
# Keep the order as it triggers chained dependencies (ogg needed by others, etc.)
256
257
if not env["builtin_libtheora"]:
258
env["builtin_libogg"] = False # Needed to link against system libtheora
259
env["builtin_libvorbis"] = False # Needed to link against system libtheora
260
if env.editor_build:
261
env.ParseConfig("pkg-config theora theoradec theoraenc --cflags --libs")
262
else:
263
env.ParseConfig("pkg-config theora theoradec --cflags --libs")
264
else:
265
if env["arch"] in ["x86_64", "x86_32"]:
266
env["x86_libtheora_opt_gcc"] = True
267
268
if not env["builtin_libvorbis"]:
269
env["builtin_libogg"] = False # Needed to link against system libvorbis
270
if env.editor_build:
271
env.ParseConfig("pkg-config vorbis vorbisfile vorbisenc --cflags --libs")
272
else:
273
env.ParseConfig("pkg-config vorbis vorbisfile --cflags --libs")
274
275
if not env["builtin_libogg"]:
276
env.ParseConfig("pkg-config ogg --cflags --libs")
277
278
if not env["builtin_libwebp"]:
279
env.ParseConfig("pkg-config libwebp --cflags --libs")
280
281
if not env["builtin_libjpeg_turbo"]:
282
env.ParseConfig("pkg-config libturbojpeg --cflags --libs")
283
284
if not env["builtin_mbedtls"]:
285
# mbedTLS only provides a pkgconfig file since 3.6.0, but we still support 2.28.x,
286
# so fallback to manually specifying LIBS if it fails.
287
if os.system("pkg-config --exists mbedtls") == 0: # 0 means found
288
env.ParseConfig("pkg-config mbedtls mbedcrypto mbedx509 --cflags --libs")
289
else:
290
env.Append(LIBS=["mbedtls", "mbedcrypto", "mbedx509"])
291
292
if not env["builtin_wslay"]:
293
env.ParseConfig("pkg-config libwslay --cflags --libs")
294
295
if not env["builtin_miniupnpc"]:
296
env.ParseConfig("pkg-config miniupnpc --cflags --libs")
297
298
# On Linux wchar_t should be 32-bits
299
# 16-bit library shouldn't be required due to compiler optimizations
300
if not env["builtin_pcre2"]:
301
env.ParseConfig("pkg-config libpcre2-32 --cflags --libs")
302
303
if not env["builtin_recastnavigation"]:
304
# No pkgconfig file so far, hardcode default paths.
305
env.Prepend(CPPEXTPATH=["/usr/include/recastnavigation"])
306
env.Append(LIBS=["Recast"])
307
308
if not env["builtin_embree"] and env["arch"] in ["x86_64", "arm64"]:
309
# No pkgconfig file so far, hardcode expected lib name.
310
env.Append(LIBS=["embree4"])
311
312
if not env["builtin_openxr"]:
313
env.ParseConfig("pkg-config openxr --cflags --libs")
314
315
if env["fontconfig"]:
316
if not env["use_sowrap"]:
317
if os.system("pkg-config --exists fontconfig") == 0: # 0 means found
318
env.ParseConfig("pkg-config fontconfig --cflags --libs")
319
env.Append(CPPDEFINES=["FONTCONFIG_ENABLED"])
320
else:
321
print_warning("fontconfig development libraries not found. Disabling the system fonts support.")
322
env["fontconfig"] = False
323
else:
324
env.Append(CPPDEFINES=["FONTCONFIG_ENABLED"])
325
326
if env["alsa"]:
327
if not env["use_sowrap"]:
328
if os.system("pkg-config --exists alsa") == 0: # 0 means found
329
env.ParseConfig("pkg-config alsa --cflags --libs")
330
env.Append(CPPDEFINES=["ALSA_ENABLED", "ALSAMIDI_ENABLED"])
331
else:
332
print_warning("ALSA development libraries not found. Disabling the ALSA audio driver.")
333
env["alsa"] = False
334
else:
335
env.Append(CPPDEFINES=["ALSA_ENABLED", "ALSAMIDI_ENABLED"])
336
337
if env["pulseaudio"]:
338
if not env["use_sowrap"]:
339
if os.system("pkg-config --exists libpulse") == 0: # 0 means found
340
env.ParseConfig("pkg-config libpulse --cflags --libs")
341
env.Append(CPPDEFINES=["PULSEAUDIO_ENABLED"])
342
else:
343
print_warning("PulseAudio development libraries not found. Disabling the PulseAudio audio driver.")
344
env["pulseaudio"] = False
345
else:
346
env.Append(CPPDEFINES=["PULSEAUDIO_ENABLED", "_REENTRANT"])
347
348
if env["dbus"] and env["threads"]: # D-Bus functionality expects threads.
349
if not env["use_sowrap"]:
350
if os.system("pkg-config --exists dbus-1") == 0: # 0 means found
351
env.ParseConfig("pkg-config dbus-1 --cflags --libs")
352
env.Append(CPPDEFINES=["DBUS_ENABLED"])
353
else:
354
print_warning("D-Bus development libraries not found. Disabling screensaver prevention.")
355
env["dbus"] = False
356
else:
357
env.Append(CPPDEFINES=["DBUS_ENABLED"])
358
359
if env["speechd"]:
360
if not env["use_sowrap"]:
361
if os.system("pkg-config --exists speech-dispatcher") == 0: # 0 means found
362
env.ParseConfig("pkg-config speech-dispatcher --cflags --libs")
363
env.Append(CPPDEFINES=["SPEECHD_ENABLED"])
364
else:
365
print_warning("speech-dispatcher development libraries not found. Disabling text to speech support.")
366
env["speechd"] = False
367
else:
368
env.Append(CPPDEFINES=["SPEECHD_ENABLED"])
369
370
if not env["use_sowrap"]:
371
if os.system("pkg-config --exists xkbcommon") == 0: # 0 means found
372
env.ParseConfig("pkg-config xkbcommon --cflags --libs")
373
env.Append(CPPDEFINES=["XKB_ENABLED"])
374
else:
375
if env["wayland"]:
376
print_error("libxkbcommon development libraries required by Wayland not found. Aborting.")
377
sys.exit(255)
378
else:
379
print_warning(
380
"libxkbcommon development libraries not found. Disabling dead key composition and key label support."
381
)
382
else:
383
env.Append(CPPDEFINES=["XKB_ENABLED"])
384
385
if platform.system() == "Linux":
386
if env["udev"]:
387
if not env["use_sowrap"]:
388
if os.system("pkg-config --exists libudev") == 0: # 0 means found
389
env.ParseConfig("pkg-config libudev --cflags --libs")
390
env.Append(CPPDEFINES=["UDEV_ENABLED"])
391
else:
392
print_warning("libudev development libraries not found. Disabling controller hotplugging support.")
393
env["udev"] = False
394
else:
395
env.Append(CPPDEFINES=["UDEV_ENABLED"])
396
else:
397
env["udev"] = False # Linux specific
398
399
if env["sdl"]:
400
if env["builtin_sdl"]:
401
env.Append(CPPDEFINES=["SDL_ENABLED"])
402
elif os.system("pkg-config --exists sdl3") == 0: # 0 means found
403
env.ParseConfig("pkg-config sdl3 --cflags --libs")
404
env.Append(CPPDEFINES=["SDL_ENABLED"])
405
else:
406
print_warning(
407
"SDL3 development libraries not found, and `builtin_sdl` was explicitly disabled. Disabling SDL input driver support."
408
)
409
env["sdl"] = False
410
411
# Linkflags below this line should typically stay the last ones
412
if not env["builtin_zlib"]:
413
env.ParseConfig("pkg-config zlib --cflags --libs")
414
415
env.Prepend(CPPPATH=["#platform/linuxbsd"])
416
if env["use_sowrap"]:
417
env.Prepend(CPPEXTPATH=["#thirdparty/linuxbsd_headers"])
418
419
env.Append(
420
CPPDEFINES=[
421
"LINUXBSD_ENABLED",
422
"UNIX_ENABLED",
423
("_FILE_OFFSET_BITS", 64),
424
]
425
)
426
427
if env["x11"]:
428
if not env["use_sowrap"]:
429
if os.system("pkg-config --exists x11"):
430
print_error("X11 libraries not found. Aborting.")
431
sys.exit(255)
432
env.ParseConfig("pkg-config x11 --cflags --libs")
433
if os.system("pkg-config --exists xcursor"):
434
print_error("Xcursor library not found. Aborting.")
435
sys.exit(255)
436
env.ParseConfig("pkg-config xcursor --cflags --libs")
437
if os.system("pkg-config --exists xinerama"):
438
print_error("Xinerama library not found. Aborting.")
439
sys.exit(255)
440
env.ParseConfig("pkg-config xinerama --cflags --libs")
441
if os.system("pkg-config --exists xext"):
442
print_error("Xext library not found. Aborting.")
443
sys.exit(255)
444
env.ParseConfig("pkg-config xext --cflags --libs")
445
if os.system("pkg-config --exists xrandr"):
446
print_error("XrandR library not found. Aborting.")
447
sys.exit(255)
448
env.ParseConfig("pkg-config xrandr --cflags --libs")
449
if os.system("pkg-config --exists xrender"):
450
print_error("XRender library not found. Aborting.")
451
sys.exit(255)
452
env.ParseConfig("pkg-config xrender --cflags --libs")
453
if os.system("pkg-config --exists xi"):
454
print_error("Xi library not found. Aborting.")
455
sys.exit(255)
456
env.ParseConfig("pkg-config xi --cflags --libs")
457
env.Append(CPPDEFINES=["X11_ENABLED"])
458
459
if env["wayland"]:
460
if not env["use_sowrap"]:
461
if os.system("pkg-config --exists libdecor-0"):
462
print_warning("libdecor development libraries not found. Disabling client-side decorations.")
463
env["libdecor"] = False
464
else:
465
env.ParseConfig("pkg-config libdecor-0 --cflags --libs")
466
if os.system("pkg-config --exists wayland-client"):
467
print_error("Wayland client library not found. Aborting.")
468
sys.exit(255)
469
env.ParseConfig("pkg-config wayland-client --cflags --libs")
470
if os.system("pkg-config --exists wayland-cursor"):
471
print_error("Wayland cursor library not found. Aborting.")
472
sys.exit(255)
473
env.ParseConfig("pkg-config wayland-cursor --cflags --libs")
474
if os.system("pkg-config --exists wayland-egl"):
475
print_error("Wayland EGL library not found. Aborting.")
476
sys.exit(255)
477
env.ParseConfig("pkg-config wayland-egl --cflags --libs")
478
else:
479
env.Prepend(CPPEXTPATH=["#thirdparty/linuxbsd_headers/wayland/"])
480
if env["libdecor"]:
481
env.Prepend(CPPEXTPATH=["#thirdparty/linuxbsd_headers/libdecor-0/"])
482
483
if env["libdecor"]:
484
env.Append(CPPDEFINES=["LIBDECOR_ENABLED"])
485
486
env.Append(CPPDEFINES=["WAYLAND_ENABLED"])
487
env.Append(LIBS=["rt"]) # Needed by glibc, used by _allocate_shm_file
488
489
if env["accesskit"]:
490
if env["accesskit_sdk_path"] != "":
491
env.Prepend(CPPPATH=[env["accesskit_sdk_path"] + "/include"])
492
if env["arch"] == "arm64":
493
env.Append(LIBPATH=[env["accesskit_sdk_path"] + "/lib/linux/arm64/static/"])
494
elif env["arch"] == "arm32":
495
env.Append(LIBPATH=[env["accesskit_sdk_path"] + "/lib/linux/arm32/static/"])
496
elif env["arch"] == "rv64":
497
env.Append(LIBPATH=[env["accesskit_sdk_path"] + "/lib/linux/riscv64gc/static/"])
498
elif env["arch"] == "x86_64":
499
env.Append(LIBPATH=[env["accesskit_sdk_path"] + "/lib/linux/x86_64/static/"])
500
elif env["arch"] == "x86_32":
501
env.Append(LIBPATH=[env["accesskit_sdk_path"] + "/lib/linux/x86/static/"])
502
env.Append(LIBS=["accesskit"])
503
else:
504
env.Append(CPPDEFINES=["ACCESSKIT_DYNAMIC"])
505
env.Append(CPPDEFINES=["ACCESSKIT_ENABLED"])
506
507
if env["vulkan"]:
508
env.Append(CPPDEFINES=["VULKAN_ENABLED", "RD_ENABLED"])
509
if not env["use_volk"]:
510
env.ParseConfig("pkg-config vulkan --cflags --libs")
511
if not env["builtin_glslang"]:
512
# No pkgconfig file so far, hardcode expected lib name.
513
env.Append(LIBS=["glslang", "SPIRV"])
514
515
if env["opengl3"]:
516
env.Append(CPPDEFINES=["GLES3_ENABLED"])
517
518
env.Append(LIBS=["pthread"])
519
520
if platform.system() == "Linux":
521
env.Append(LIBS=["dl"])
522
523
if platform.libc_ver()[0] != "glibc":
524
if env["execinfo"]:
525
env.Append(LIBS=["execinfo"])
526
env.Append(CPPDEFINES=["CRASH_HANDLER_ENABLED"])
527
else:
528
# The default crash handler depends on glibc, so if the host uses
529
# a different libc (BSD libc, musl), libexecinfo is required.
530
print_info("Using `execinfo=no` disables the crash handler on platforms where glibc is missing.")
531
else:
532
env.Append(CPPDEFINES=["CRASH_HANDLER_ENABLED"])
533
534
if platform.system() == "FreeBSD":
535
env.Append(LINKFLAGS=["-lkvm"])
536
537
# Link those statically for portability
538
if env["use_static_cpp"]:
539
env.Append(LINKFLAGS=["-static-libgcc", "-static-libstdc++"])
540
if env["use_llvm"] and platform.system() != "FreeBSD":
541
env["LINKCOM"] = env["LINKCOM"] + " -l:libatomic.a"
542
else:
543
if env["use_llvm"] and platform.system() != "FreeBSD":
544
env.Append(LIBS=["atomic"])
545
546