Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/platform/linuxbsd/detect.py
10277 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(CCFLAGS=["-DSANITIZERS_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_mbedtls"]:
282
# mbedTLS only provides a pkgconfig file since 3.6.0, but we still support 2.28.x,
283
# so fallback to manually specifying LIBS if it fails.
284
if os.system("pkg-config --exists mbedtls") == 0: # 0 means found
285
env.ParseConfig("pkg-config mbedtls mbedcrypto mbedx509 --cflags --libs")
286
else:
287
env.Append(LIBS=["mbedtls", "mbedcrypto", "mbedx509"])
288
289
if not env["builtin_wslay"]:
290
env.ParseConfig("pkg-config libwslay --cflags --libs")
291
292
if not env["builtin_miniupnpc"]:
293
env.ParseConfig("pkg-config miniupnpc --cflags --libs")
294
295
# On Linux wchar_t should be 32-bits
296
# 16-bit library shouldn't be required due to compiler optimizations
297
if not env["builtin_pcre2"]:
298
env.ParseConfig("pkg-config libpcre2-32 --cflags --libs")
299
300
if not env["builtin_recastnavigation"]:
301
# No pkgconfig file so far, hardcode default paths.
302
env.Prepend(CPPEXTPATH=["/usr/include/recastnavigation"])
303
env.Append(LIBS=["Recast"])
304
305
if not env["builtin_embree"] and env["arch"] in ["x86_64", "arm64"]:
306
# No pkgconfig file so far, hardcode expected lib name.
307
env.Append(LIBS=["embree4"])
308
309
if not env["builtin_openxr"]:
310
env.ParseConfig("pkg-config openxr --cflags --libs")
311
312
if env["fontconfig"]:
313
if not env["use_sowrap"]:
314
if os.system("pkg-config --exists fontconfig") == 0: # 0 means found
315
env.ParseConfig("pkg-config fontconfig --cflags --libs")
316
env.Append(CPPDEFINES=["FONTCONFIG_ENABLED"])
317
else:
318
print_warning("fontconfig development libraries not found. Disabling the system fonts support.")
319
env["fontconfig"] = False
320
else:
321
env.Append(CPPDEFINES=["FONTCONFIG_ENABLED"])
322
323
if env["alsa"]:
324
if not env["use_sowrap"]:
325
if os.system("pkg-config --exists alsa") == 0: # 0 means found
326
env.ParseConfig("pkg-config alsa --cflags --libs")
327
env.Append(CPPDEFINES=["ALSA_ENABLED", "ALSAMIDI_ENABLED"])
328
else:
329
print_warning("ALSA development libraries not found. Disabling the ALSA audio driver.")
330
env["alsa"] = False
331
else:
332
env.Append(CPPDEFINES=["ALSA_ENABLED", "ALSAMIDI_ENABLED"])
333
334
if env["pulseaudio"]:
335
if not env["use_sowrap"]:
336
if os.system("pkg-config --exists libpulse") == 0: # 0 means found
337
env.ParseConfig("pkg-config libpulse --cflags --libs")
338
env.Append(CPPDEFINES=["PULSEAUDIO_ENABLED"])
339
else:
340
print_warning("PulseAudio development libraries not found. Disabling the PulseAudio audio driver.")
341
env["pulseaudio"] = False
342
else:
343
env.Append(CPPDEFINES=["PULSEAUDIO_ENABLED", "_REENTRANT"])
344
345
if env["dbus"] and env["threads"]: # D-Bus functionality expects threads.
346
if not env["use_sowrap"]:
347
if os.system("pkg-config --exists dbus-1") == 0: # 0 means found
348
env.ParseConfig("pkg-config dbus-1 --cflags --libs")
349
env.Append(CPPDEFINES=["DBUS_ENABLED"])
350
else:
351
print_warning("D-Bus development libraries not found. Disabling screensaver prevention.")
352
env["dbus"] = False
353
else:
354
env.Append(CPPDEFINES=["DBUS_ENABLED"])
355
356
if env["speechd"]:
357
if not env["use_sowrap"]:
358
if os.system("pkg-config --exists speech-dispatcher") == 0: # 0 means found
359
env.ParseConfig("pkg-config speech-dispatcher --cflags --libs")
360
env.Append(CPPDEFINES=["SPEECHD_ENABLED"])
361
else:
362
print_warning("speech-dispatcher development libraries not found. Disabling text to speech support.")
363
env["speechd"] = False
364
else:
365
env.Append(CPPDEFINES=["SPEECHD_ENABLED"])
366
367
if not env["use_sowrap"]:
368
if os.system("pkg-config --exists xkbcommon") == 0: # 0 means found
369
env.ParseConfig("pkg-config xkbcommon --cflags --libs")
370
env.Append(CPPDEFINES=["XKB_ENABLED"])
371
else:
372
if env["wayland"]:
373
print_error("libxkbcommon development libraries required by Wayland not found. Aborting.")
374
sys.exit(255)
375
else:
376
print_warning(
377
"libxkbcommon development libraries not found. Disabling dead key composition and key label support."
378
)
379
else:
380
env.Append(CPPDEFINES=["XKB_ENABLED"])
381
382
if platform.system() == "Linux":
383
if env["udev"]:
384
if not env["use_sowrap"]:
385
if os.system("pkg-config --exists libudev") == 0: # 0 means found
386
env.ParseConfig("pkg-config libudev --cflags --libs")
387
env.Append(CPPDEFINES=["UDEV_ENABLED"])
388
else:
389
print_warning("libudev development libraries not found. Disabling controller hotplugging support.")
390
env["udev"] = False
391
else:
392
env.Append(CPPDEFINES=["UDEV_ENABLED"])
393
else:
394
env["udev"] = False # Linux specific
395
396
if env["sdl"]:
397
if env["builtin_sdl"]:
398
env.Append(CPPDEFINES=["SDL_ENABLED"])
399
elif os.system("pkg-config --exists sdl3") == 0: # 0 means found
400
env.ParseConfig("pkg-config sdl3 --cflags --libs")
401
env.Append(CPPDEFINES=["SDL_ENABLED"])
402
else:
403
print_warning(
404
"SDL3 development libraries not found, and `builtin_sdl` was explicitly disabled. Disabling SDL input driver support."
405
)
406
env["sdl"] = False
407
408
# Linkflags below this line should typically stay the last ones
409
if not env["builtin_zlib"]:
410
env.ParseConfig("pkg-config zlib --cflags --libs")
411
412
env.Prepend(CPPPATH=["#platform/linuxbsd"])
413
if env["use_sowrap"]:
414
env.Prepend(CPPEXTPATH=["#thirdparty/linuxbsd_headers"])
415
416
env.Append(
417
CPPDEFINES=[
418
"LINUXBSD_ENABLED",
419
"UNIX_ENABLED",
420
("_FILE_OFFSET_BITS", 64),
421
]
422
)
423
424
if env["x11"]:
425
if not env["use_sowrap"]:
426
if os.system("pkg-config --exists x11"):
427
print_error("X11 libraries not found. Aborting.")
428
sys.exit(255)
429
env.ParseConfig("pkg-config x11 --cflags --libs")
430
if os.system("pkg-config --exists xcursor"):
431
print_error("Xcursor library not found. Aborting.")
432
sys.exit(255)
433
env.ParseConfig("pkg-config xcursor --cflags --libs")
434
if os.system("pkg-config --exists xinerama"):
435
print_error("Xinerama library not found. Aborting.")
436
sys.exit(255)
437
env.ParseConfig("pkg-config xinerama --cflags --libs")
438
if os.system("pkg-config --exists xext"):
439
print_error("Xext library not found. Aborting.")
440
sys.exit(255)
441
env.ParseConfig("pkg-config xext --cflags --libs")
442
if os.system("pkg-config --exists xrandr"):
443
print_error("XrandR library not found. Aborting.")
444
sys.exit(255)
445
env.ParseConfig("pkg-config xrandr --cflags --libs")
446
if os.system("pkg-config --exists xrender"):
447
print_error("XRender library not found. Aborting.")
448
sys.exit(255)
449
env.ParseConfig("pkg-config xrender --cflags --libs")
450
if os.system("pkg-config --exists xi"):
451
print_error("Xi library not found. Aborting.")
452
sys.exit(255)
453
env.ParseConfig("pkg-config xi --cflags --libs")
454
env.Append(CPPDEFINES=["X11_ENABLED"])
455
456
if env["wayland"]:
457
if not env["use_sowrap"]:
458
if os.system("pkg-config --exists libdecor-0"):
459
print_warning("libdecor development libraries not found. Disabling client-side decorations.")
460
env["libdecor"] = False
461
else:
462
env.ParseConfig("pkg-config libdecor-0 --cflags --libs")
463
if os.system("pkg-config --exists wayland-client"):
464
print_error("Wayland client library not found. Aborting.")
465
sys.exit(255)
466
env.ParseConfig("pkg-config wayland-client --cflags --libs")
467
if os.system("pkg-config --exists wayland-cursor"):
468
print_error("Wayland cursor library not found. Aborting.")
469
sys.exit(255)
470
env.ParseConfig("pkg-config wayland-cursor --cflags --libs")
471
if os.system("pkg-config --exists wayland-egl"):
472
print_error("Wayland EGL library not found. Aborting.")
473
sys.exit(255)
474
env.ParseConfig("pkg-config wayland-egl --cflags --libs")
475
else:
476
env.Prepend(CPPEXTPATH=["#thirdparty/linuxbsd_headers/wayland/"])
477
if env["libdecor"]:
478
env.Prepend(CPPEXTPATH=["#thirdparty/linuxbsd_headers/libdecor-0/"])
479
480
if env["libdecor"]:
481
env.Append(CPPDEFINES=["LIBDECOR_ENABLED"])
482
483
env.Append(CPPDEFINES=["WAYLAND_ENABLED"])
484
env.Append(LIBS=["rt"]) # Needed by glibc, used by _allocate_shm_file
485
486
if env["accesskit"]:
487
if env["accesskit_sdk_path"] != "":
488
env.Prepend(CPPPATH=[env["accesskit_sdk_path"] + "/include"])
489
if env["arch"] == "arm64":
490
env.Append(LIBPATH=[env["accesskit_sdk_path"] + "/lib/linux/arm64/static/"])
491
elif env["arch"] == "arm32":
492
env.Append(LIBPATH=[env["accesskit_sdk_path"] + "/lib/linux/arm32/static/"])
493
elif env["arch"] == "rv64":
494
env.Append(LIBPATH=[env["accesskit_sdk_path"] + "/lib/linux/riscv64gc/static/"])
495
elif env["arch"] == "x86_64":
496
env.Append(LIBPATH=[env["accesskit_sdk_path"] + "/lib/linux/x86_64/static/"])
497
elif env["arch"] == "x86_32":
498
env.Append(LIBPATH=[env["accesskit_sdk_path"] + "/lib/linux/x86/static/"])
499
env.Append(LIBS=["accesskit"])
500
else:
501
env.Append(CPPDEFINES=["ACCESSKIT_DYNAMIC"])
502
env.Append(CPPDEFINES=["ACCESSKIT_ENABLED"])
503
504
if env["vulkan"]:
505
env.Append(CPPDEFINES=["VULKAN_ENABLED", "RD_ENABLED"])
506
if not env["use_volk"]:
507
env.ParseConfig("pkg-config vulkan --cflags --libs")
508
if not env["builtin_glslang"]:
509
# No pkgconfig file so far, hardcode expected lib name.
510
env.Append(LIBS=["glslang", "SPIRV"])
511
512
if env["opengl3"]:
513
env.Append(CPPDEFINES=["GLES3_ENABLED"])
514
515
env.Append(LIBS=["pthread"])
516
517
if platform.system() == "Linux":
518
env.Append(LIBS=["dl"])
519
520
if platform.libc_ver()[0] != "glibc":
521
if env["execinfo"]:
522
env.Append(LIBS=["execinfo"])
523
env.Append(CPPDEFINES=["CRASH_HANDLER_ENABLED"])
524
else:
525
# The default crash handler depends on glibc, so if the host uses
526
# a different libc (BSD libc, musl), libexecinfo is required.
527
print_info("Using `execinfo=no` disables the crash handler on platforms where glibc is missing.")
528
else:
529
env.Append(CPPDEFINES=["CRASH_HANDLER_ENABLED"])
530
531
if platform.system() == "FreeBSD":
532
env.Append(LINKFLAGS=["-lkvm"])
533
534
# Link those statically for portability
535
if env["use_static_cpp"]:
536
env.Append(LINKFLAGS=["-static-libgcc", "-static-libstdc++"])
537
if env["use_llvm"] and platform.system() != "FreeBSD":
538
env["LINKCOM"] = env["LINKCOM"] + " -l:libatomic.a"
539
else:
540
if env["use_llvm"] and platform.system() != "FreeBSD":
541
env.Append(LIBS=["atomic"])
542
543