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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Jul 10, 2017 at 09:24 UTC 566cf0b3bd6458a74e8a3df8c01d27f35e7814f2
1 file changed +3
Makefile
+3
@@ -994,6 +994,9 @@ endif
994 ifdef SANITIZE
995 BASIC_CFLAGS += -fsanitize=$(SANITIZE) -fno-sanitize-recover=$(SANITIZE)
996 BASIC_CFLAGS += -fno-omit-frame-pointer
997 +ifeq ($(SANITIZE),undefined)
998 +BASIC_CFLAGS += -DNO_UNALIGNED_LOADS
999 +endif
1000 endif
1001
1002 ifndef sysconfdir