diff options
author | Andrew Kaster <andrewdkaster@gmail.com> | 2021-05-23 19:40:22 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-27 15:18:03 +0200 |
commit | 4a5a1e864894a2d3ac80fdf061a34f5e6a29abfb (patch) | |
tree | 8e33a4f87838764c0b8df85a3065def5e0037ced /Userland/DynamicLoader | |
parent | 505f84daae62ff6b0c94eb2551fd69e87e56823f (diff) | |
download | serenity-4a5a1e864894a2d3ac80fdf061a34f5e6a29abfb.zip |
Userland: Port UBSAN implementation to userspace
Take Kernel/UBSanitizer.cpp and make a copy in LibSanitizer.
We can use LibSanitizer to hold other sanitizers as people implement
them :^).
To enable UBSAN for LibC, DynamicLoader, and other low level system
libraries, LibUBSanitizer is built as a serenity_libc, and has a static
version for LibCStatic to use. The approach is the same as that taken in
Note that this means now UBSAN is enabled for code generators, Lagom,
Kernel, and Userspace with -DENABLE_UNDEFINED_SANTIZER=ON. In userspace
however, UBSAN is not deadly (yet).
Co-authored-by: ForLoveOfCats <ForLoveOfCats@vivaldi.net>
Diffstat (limited to 'Userland/DynamicLoader')
-rw-r--r-- | Userland/DynamicLoader/CMakeLists.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/DynamicLoader/CMakeLists.txt b/Userland/DynamicLoader/CMakeLists.txt index dd9cb3dc03..8c7a883e54 100644 --- a/Userland/DynamicLoader/CMakeLists.txt +++ b/Userland/DynamicLoader/CMakeLists.txt @@ -18,6 +18,10 @@ endif() file(GLOB LIBSYSTEM_SOURCES "../Libraries/LibSystem/*.cpp") +if (ENABLE_UNDEFINED_SANITIZER) + set(LOADER_SOURCES ${LOADER_SOURCES} ../Libraries/LibSanitizer/UBSanitizer.cpp) +endif() + add_definitions(-D_DYNAMIC_LOADER) set(SOURCES ${LOADER_SOURCES} ${AK_SOURCES} ${ELF_SOURCES} ${LIBC_SOURCES1} ${LIBC_SOURCES2} ${LIBC_SOURCES3} ${LIBSYSTEM_SOURCES}) |