diff --git a/Makefile b/Makefile index 5580859afd..3cf1ff4d06 100644 --- a/Makefile +++ b/Makefile @@ -1221,8 +1221,9 @@ PTHREAD_CFLAGS = SPARSE_FLAGS ?= -std=gnu99 SP_EXTRA_FLAGS = -Wno-universal-initializer -# For informing GIT-BUILD-OPTIONS of the SANITIZE=leak target +# For informing GIT-BUILD-OPTIONS of the SANITIZE=leak,address targets SANITIZE_LEAK = +SANITIZE_ADDRESS = # For the 'coccicheck' target; setting SPATCH_BATCH_SIZE higher will # usually result in less CPU usage at the cost of higher peak memory. @@ -1272,6 +1273,7 @@ SANITIZE_LEAK = YesCompiledWithIt endif ifneq ($(filter address,$(SANITIZERS)),) NO_REGEX = NeededForASAN +SANITIZE_ADDRESS = YesCompiledWithIt endif endif @@ -2853,6 +2855,7 @@ GIT-BUILD-OPTIONS: FORCE @echo PAGER_ENV=\''$(subst ','\'',$(subst ','\'',$(PAGER_ENV)))'\' >>$@+ @echo DC_SHA1=\''$(subst ','\'',$(subst ','\'',$(DC_SHA1)))'\' >>$@+ @echo SANITIZE_LEAK=\''$(subst ','\'',$(subst ','\'',$(SANITIZE_LEAK)))'\' >>$@+ + @echo SANITIZE_ADDRESS=\''$(subst ','\'',$(subst ','\'',$(SANITIZE_ADDRESS)))'\' >>$@+ @echo X=\'$(X)\' >>$@+ ifdef TEST_OUTPUT_DIRECTORY @echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@+ diff --git a/t/test-lib.sh b/t/test-lib.sh index cf3fa4514a..28ac9e2ca1 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -503,9 +503,10 @@ case $GIT_TEST_FSYNC in ;; esac -# Add libc MALLOC and MALLOC_PERTURB test -# only if we are not executing the test with valgrind +# Add libc MALLOC and MALLOC_PERTURB test only if we are not executing +# the test with valgrind and have not compiled with SANITIZE=address. if test -n "$valgrind" || + test -n "$SANITIZE_ADDRESS" || test -n "$TEST_NO_MALLOC_CHECK" then setup_malloc_check () {