Skip to content

Commit 1fb25c2

Browse files
committed
fix(build): define CBM_SANITIZED_BUILD in TSan flags too
CFLAGS_TEST/CXXFLAGS_TEST already define CBM_SANITIZED_BUILD via SANITIZED_DEFINE, but CFLAGS_TSAN/CXXFLAGS_TSAN never did. This left mem_override_posix.c's !defined(CBM_SANITIZED_BUILD) guard always true under make test-tsan, compiling __wrap_free/__wrap_realloc (with their __real_free/__real_realloc forward declarations) into a link that never passes -Wl,--wrap=... — undefined reference at link time. Signed-off-by: Pedro Ramos <131530838+pr9000@users.noreply.github.com>
1 parent 2496d8f commit 1fb25c2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎Makefile.cbm‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ CXXFLAGS_TEST = $(CXXFLAGS_COMMON) $(SANITIZED_DEFINE) -g -O1 $(SANITIZE)
8383
# TSan (can't combine with ASan)
8484
TSAN_SANITIZE = -fsanitize=thread -fno-omit-frame-pointer
8585
CFLAGS_TSAN = $(CFLAGS_COMMON) $(EDITOR_TEST_DEFINES) -g -O1 \
86-
$(TSAN_SANITIZE)
86+
$(SANITIZED_DEFINE) $(TSAN_SANITIZE)
8787
CXXFLAGS_TSAN = $(CXXFLAGS_COMMON) -g -O1 \
88-
$(TSAN_SANITIZE)
88+
$(SANITIZED_DEFINE) $(TSAN_SANITIZE)
8989

9090
# Windows needs ws2_32 (Winsock), psapi (GetProcessMemoryInfo), shell32
9191
# (CommandLineToArgvW — the UTF-8 argv path in main.c, #423/#20), and

0 commit comments

Comments
 (0)