Fix ASan build on FreeBSD#10
Open
vkrivopalov wants to merge 1 commit into
Open
Conversation
Introduce two fixes to CMake to support ASan-enabled builds on FreeBSD: 1. Move add_subdirectory(test) inside if(LUAJIT_USE_TEST) block. Previously, the test directory was configured unconditionally even when LUAJIT_USE_TEST was OFF, wasting configuration time and potentially triggering errors in the test setup. 2. Skip libstdc++ LD_PRELOAD workaround on FreeBSD. The workaround for google/sanitizers#934 assumes GCC's libstdc++, but FreeBSD uses LLVM's libc++ and doesn't require this workaround. Signed-off-by: Vladimir Krivopalov <argenet@yandex.ru>
Author
|
Hi @Buristan, I looked at another PR currently opened in this repo and found you reply that patches for Tarantool's LuaJIT should go into the mailing list. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This MR fixes LuaJIT ASan-instrumented builds on FreeBSD, which currently fail with:
Two issues combine to cause this failure:
add_subdirectory(test)is called unconditionally in the rootCMakeLists.txt, even whenLUAJIT_USE_TEST=OFF.This means test configuration runs regardless of whether tests are needed.
LUAJIT_USE_ASAN=ON,test/LuaJIT-tests/CMakeLists.txtsearches forlibstdc++.soto set up anLD_PRELOADworkaround for AddressSanitizer CHECK failed: ../../../sanitizer/asan/asan_interceptors.cc:384 "((__interception::real___cxa_throw)) when using --as-needed and dynamically loaded .so google/sanitizers#934. This workaround is GCC-specific, but FreeBSD uses clang withlibc++, notlibstdc++.Verified on FreeBSD 15.0 with clang 19: