build-compiler-rt: Include atomics helpers in the builtins library

These helpers are statically linked into each DLL/EXE that uses
them.

They are primarily used for atomic access to variables that are
larger than what the platform natively can support - i.e. primarily
for accessing atomic variables larger than 8 bytes.

The fallback implementations rely on explicit locks (spinlocks
in practice).

As the locks are statically linked into each module that uses the
atomic variable, any concurrent access to such an atomic variable
from two different DLLs/EXEs wouldn't actually end up being
properly atomic.

However cross-module atomic variables (larger than 8 bytes) is
very rare so this isn't deemed to be much of a practical issue.

In GCC based toolchains, the corresponding helpers reside in
a separate shared library, libatomic-1.dll (although it can also
be linked statically).
This commit is contained in:
Martin Storsjö committed 2024-01-24 09:11:40 +02:00
1 parent 7bbbf7c65f
commit c6f48859d8
1 file changed
+1
+1
View File
@@ -113,6 +113,7 @@ for arch in $ARCHS; do
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=TRUE \
-DCOMPILER_RT_USE_BUILTINS_LIBRARY=TRUE \
-DCOMPILER_RT_BUILD_BUILTINS=$BUILD_BUILTINS \
-DCOMPILER_RT_EXCLUDE_ATOMIC_BUILTIN=FALSE \
-DLLVM_CONFIG_PATH="" \
-DCMAKE_FIND_ROOT_PATH=$PREFIX/$arch-w64-mingw32 \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \