Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable LLD linker to enable UBSan #705

Merged
merged 2 commits into from
Jun 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions production/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
# Ensure debug builds have the DEBUG flag defined.
add_compile_options("$<$<CONFIG:DEBUG>:-DDEBUG>")

# Use the LLVM linker rather than GNU ld (required for UBSan).
add_link_options("-fuse-ld=lld")

# Set some global variables.
get_repo_root(${PROJECT_SOURCE_DIR} GAIA_REPO)

Expand All @@ -56,6 +59,7 @@ if(BUILD_GAIA_RELEASE OR BUILD_GAIA_LLVM_TESTS)
set(LLVM_ENABLE_EH ON CACHE BOOL "")
set(LLVM_ENABLE_PROJECTS "clang" CACHE STRING "")
set(LLVM_ENABLE_RTTI ON CACHE BOOL "")
set(LLVM_USE_LINKER "lld" CACHE STRING "")
endif()

# Debug build-specific options.
Expand Down
1 change: 1 addition & 0 deletions production/gdev.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[apt]
lld
clang-format
clang-tidy
{enable_if('GaiaRelease')}debhelper
Expand Down