Skip to content

Commit

Permalink
patches: support instrumenting dlmalloc by ASAN
Browse files Browse the repository at this point in the history
  • Loading branch information
ligurio committed Aug 17, 2024
1 parent 159a488 commit 47f3990
Show file tree
Hide file tree
Showing 2 changed files with 429 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmake/BuildLuaJIT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ macro(build_luajit LJ_VERSION)
set(CFLAGS "${CFLAGS} -fsanitize=fuzzer-no-link")
set(LDFLAGS "-fsanitize=fuzzer-no-link")

set(LUAJIT_PATCH_PATH ${PROJECT_SOURCE_DIR}/patches/luajit-v2.1.patch)
set(LUAJIT_BASEDIR ${PROJECT_SOURCE_DIR}/patches/)

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CFLAGS "${CFLAGS} ${CMAKE_C_FLAGS_DEBUG}")
Expand Down Expand Up @@ -99,7 +99,9 @@ macro(build_luajit LJ_VERSION)
TMP_DIR ${LJ_BINARY_DIR}/tmp
STAMP_DIR ${LJ_BINARY_DIR}/stamp

PATCH_COMMAND git reset --hard && cd <SOURCE_DIR> && patch -p1 -i ${LUAJIT_PATCH_PATH}
PATCH_COMMAND git reset --hard && cd <SOURCE_DIR> &&
patch -p1 -i ${LUAJIT_BASEDIR}/luajit-v2.1.patch &&
patch -p1 -i ${LUAJIT_BASEDIR}/luajit-dmalloc-asan_instr-v2.1.patch
CONFIGURE_COMMAND ""
BUILD_COMMAND cd <SOURCE_DIR> && make -j CC=${CMAKE_C_COMPILER}
CFLAGS=${CFLAGS}
Expand Down
Loading

0 comments on commit 47f3990

Please sign in to comment.