Skip to content

Commit 325ca19

Browse files
bnoordhuischqrlie
authored andcommitted
Add MemorySanitizer support
1 parent 626e0d4 commit 325ca19

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Makefile

+11-4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ PREFIX?=/usr/local
4343
#CONFIG_PROFILE=y
4444
# use address sanitizer
4545
#CONFIG_ASAN=y
46+
# use memory sanitizer
47+
#CONFIG_MSAN=y
4648
# include the code for BigFloat/BigDecimal, math mode and faster large integers
4749
CONFIG_BIGNUM=y
4850

@@ -142,6 +144,10 @@ ifdef CONFIG_ASAN
142144
CFLAGS+=-fsanitize=address -fno-omit-frame-pointer
143145
LDFLAGS+=-fsanitize=address -fno-omit-frame-pointer
144146
endif
147+
ifdef CONFIG_MSAN
148+
CFLAGS+=-fsanitize=memory -fno-omit-frame-pointer
149+
LDFLAGS+=-fsanitize=memory -fno-omit-frame-pointer
150+
endif
145151
ifdef CONFIG_WIN32
146152
LDEXPORT=
147153
else
@@ -176,12 +182,13 @@ endif
176182

177183
# examples
178184
ifeq ($(CROSS_PREFIX),)
179-
PROGS+=examples/hello
180185
ifndef CONFIG_ASAN
181-
PROGS+=examples/hello_module
182-
endif
186+
ifndef CONFIG_MSAN
187+
PROGS+=examples/hello examples/hello_module examples/test_fib
183188
ifdef CONFIG_SHARED_LIBS
184-
PROGS+=examples/test_fib examples/fib.so examples/point.so
189+
PROGS+=examples/fib.so examples/point.so
190+
endif
191+
endif
185192
endif
186193
endif
187194

0 commit comments

Comments
 (0)