commit e901c096cd5049ed59211d75eddb96ec512801fe
parent 3ad826ae55710ff5b56acfdcfed26882ad90beb4
Author: Ben Noordhuis <info@bnoordhuis.nl>
Date: Wed, 1 Nov 2023 04:30:34 +0100
Add MemorySanitizer support
Diffstat:
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/quickjs/Makefile b/quickjs/Makefile
@@ -43,6 +43,8 @@ PREFIX?=/usr/local
#CONFIG_PROFILE=y
# use address sanitizer
#CONFIG_ASAN=y
+# use memory sanitizer
+#CONFIG_MSAN=y
# include the code for BigFloat/BigDecimal, math mode and faster large integers
CONFIG_BIGNUM=y
@@ -143,6 +145,10 @@ ifdef CONFIG_ASAN
CFLAGS+=-fsanitize=address -fno-omit-frame-pointer
LDFLAGS+=-fsanitize=address -fno-omit-frame-pointer
endif
+ifdef CONFIG_MSAN
+CFLAGS+=-fsanitize=memory -fno-omit-frame-pointer
+LDFLAGS+=-fsanitize=memory -fno-omit-frame-pointer
+endif
ifdef CONFIG_WIN32
LDEXPORT=
else
@@ -177,12 +183,13 @@ endif
# examples
ifeq ($(CROSS_PREFIX),)
-PROGS+=examples/hello
ifndef CONFIG_ASAN
-PROGS+=examples/hello_module
-endif
+ifndef CONFIG_MSAN
+PROGS+=examples/hello examples/hello_module examples/test_fib
ifdef CONFIG_SHARED_LIBS
-PROGS+=examples/test_fib examples/fib.so examples/point.so
+PROGS+=examples/fib.so examples/point.so
+endif
+endif
endif
endif