Skip to content

Commit 133bf92

Browse files
committed
Merge branch 'jk/asan-bonanza' into seen
Various issues detected by Asan have been corrected. * jk/asan-bonanza: amend! Makefile: turn on NO_MMAP when building with ASan
2 parents 9b5f5e0 + 8b60350 commit 133bf92

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

meson.build

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,12 +1413,18 @@ if host_machine.system() == 'windows'
14131413
libgit_c_args += '-DUSE_WIN32_MMAP'
14141414
else
14151415
checkfuncs += {
1416-
'mmap' : ['mmap.c'],
14171416
# provided by compat/mingw.c.
14181417
'unsetenv' : ['unsetenv.c'],
14191418
# provided by compat/mingw.c.
14201419
'getpagesize' : [],
14211420
}
1421+
1422+
if get_option('b_sanitize').contains('address')
1423+
libgit_c_args += '-DNO_MMAP'
1424+
libgit_sources += 'compat/mmap.c'
1425+
else
1426+
checkfuncs += { 'mmap': ['mmap.c'] }
1427+
endif
14221428
endif
14231429

14241430
foreach func, impls : checkfuncs

0 commit comments

Comments
 (0)