mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
Replace the execute_process() invocation in cmake/build_clang_builtin.cmake
with native add_library() targets, so compiler-rt builds the same way as
LLVM (mirroring contrib/llvm-project-cmake/).
contrib/compiler-rt-cmake/ now produces clang_rt_builtins, asan/asan_static/
asan_cxx, msan/msan_cxx, tsan/tsan_cxx, ubsan_standalone/ubsan_standalone_cxx,
and xray as regular cmake targets that are added to global-libs (so ninja
sees them as proper build-graph dependencies of every executable, instead of
relying on incidental scheduling order).
Source lists are extracted from the upstream lib/<X>/CMakeLists.txt files
with provenance comments. Build flags mirror SANITIZER_COMMON_CFLAGS plus
each component's per-target additions (-fPIE/-ffreestanding for msan,
-msse4.2 for tsan, -frtti for ubsan_cxx, etc.).
Verified by full builds in fresh folders for release+xray and SANITIZE in
{address, memory, thread, undefined}: all binaries link, run, and contain
the expected runtime symbols.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
31 lines
887 B
CMake
31 lines
887 B
CMake
# UBSan is split into common runtime, standalone runtime, and C++ ABI parts.
|
|
#
|
|
# Source: contrib/llvm-project/compiler-rt/lib/ubsan/CMakeLists.txt
|
|
# - UBSAN_SOURCES — the RTUbsan core
|
|
# - UBSAN_STANDALONE_SOURCES — RTUbsan_standalone
|
|
# - UBSAN_CXX_SOURCES — RTUbsan_cxx (only built when SANITIZER_CAN_USE_CXXABI;
|
|
# always true on Linux/FreeBSD with libcxxabi)
|
|
|
|
set(UBSAN_SOURCES
|
|
ubsan_diag.cpp
|
|
ubsan_init.cpp
|
|
ubsan_flags.cpp
|
|
ubsan_handlers.cpp
|
|
ubsan_monitor.cpp
|
|
ubsan_value.cpp
|
|
)
|
|
|
|
set(UBSAN_STANDALONE_SOURCES
|
|
ubsan_diag_standalone.cpp
|
|
ubsan_init_standalone.cpp
|
|
ubsan_signals_standalone.cpp
|
|
)
|
|
|
|
# Sources that exercise C++ RTTI (compiled with RTTI enabled).
|
|
set(UBSAN_CXX_SOURCES
|
|
ubsan_handlers_cxx.cpp
|
|
ubsan_type_hash.cpp
|
|
ubsan_type_hash_itanium.cpp
|
|
ubsan_type_hash_win.cpp
|
|
)
|