From: Jeff King Date: Mon, 10 Jul 2017 13:24:50 +0000 (-0400) Subject: Makefile: disable unaligned loads with UBSan X-Git-Tag: v2.14.0-rc0~1^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=566cf0b3bd6458a74e8a3df8c01d27f35e7814f2;p=git Makefile: disable unaligned loads with UBSan The undefined behavior sanitizer complains about unaligned loads, even if they're OK for a particular platform in practice. It's possible that they _are_ a problem, of course, but since it's a known tradeoff the UBSan errors are just noise. Let's quiet it automatically by building with NO_UNALIGNED_LOADS when SANITIZE=undefined is in use. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/Makefile b/Makefile index d03880e690..852dedc25c 100644 --- a/Makefile +++ b/Makefile @@ -994,6 +994,9 @@ 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