commit 831dfaf6374a1345cdf4512f4cc504973802afa5 from: Sergey Bronnikov date: Fri Sep 13 13:24:09 2024 UTC cmake: propagate UBsan option to LuaJIT build The commit bf01fb200777 ("luajit: bump new version") introduced the LUAJIT_USE_UBSAN option in LuaJIT. The patch propagates the CMake option ENABLE_UB_SANITIZER used in Tarantool to the LuaJIT build. Needed for #10145 NO_CHANGELOG=build NO_DOC=build NO_TEST=build (cherry picked from commit b58791cf532c5a76a6941221358ca007bc97a85b) commit - 16d11f88099b05c375ce3c45f0ff7ca2c8ded772 commit + 831dfaf6374a1345cdf4512f4cc504973802afa5 blob - 743edb9e01fa1521b8473189be23b49e4e065a49 blob + 529caf244b87783ea5586797e682d2e9292e1573 --- cmake/luajit.cmake +++ cmake/luajit.cmake @@ -81,6 +81,11 @@ if(ENABLE_ASAN) "Build LuaJIT with AddressSanitizer" FORCE) endif() +if(ENABLE_UB_SANITIZER) + set(LUAJIT_USE_UBSAN ON CACHE BOOL + "Build LuaJIT with UndefinedBehaviourSanitizer" FORCE) +endif() + if(TARGET_OS_DARWIN AND NOT LUAJIT_ENABLE_GC64) # XXX: This is not the best idea to build LuaJIT on MacOS # with GC64 disabled. But nobody will stop you from this.