summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-07-13 16:14:54 -0700
committerJunio C Hamano <gitster@pobox.com>2017-07-13 16:14:54 -0700
commit757e9874be785ef23980034b41c91c7d9db55661 (patch)
tree6406257b717bc7dcd02fe3051cc28bd62d56136c /Makefile
parentc9c63ee558ce3399bd2016388da9676d4f5ecf55 (diff)
parent566cf0b3bd6458a74e8a3df8c01d27f35e7814f2 (diff)
downloadgit-757e9874be785ef23980034b41c91c7d9db55661.tar.gz
Merge branch 'jk/build-with-asan'
The build procedure has been improved to allow building and testing Git with address sanitizer more easily. * jk/build-with-asan: Makefile: disable unaligned loads with UBSan Makefile: turn off -fomit-frame-pointer with sanitizers Makefile: add helper for compiling with -fsanitize test-lib: turn on ASan abort_on_error by default test-lib: set ASAN_OPTIONS variable before we run git
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index bfa5b3a4ca..ba4359ef8d 100644
--- a/Makefile
+++ b/Makefile
@@ -1022,6 +1022,14 @@ ifdef DEVELOPER
CFLAGS += $(DEVELOPER_CFLAGS)
endif
+ifdef SANITIZE
+BASIC_CFLAGS += -fsanitize=$(SANITIZE) -fno-sanitize-recover=$(SANITIZE)
+BASIC_CFLAGS += -fno-omit-frame-pointer
+ifeq ($(SANITIZE),undefined)
+BASIC_CFLAGS += -DNO_UNALIGNED_LOADS
+endif
+endif
+
ifndef sysconfdir
ifeq ($(prefix),/usr)
sysconfdir = /etc