1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-07 15:06:08 +02:00

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>
This commit is contained in:
Jeff King 2017-07-10 09:24:50 -04:00 committed by Junio C Hamano
parent ddbc8a6d3e
commit 566cf0b3bd

View File

@ -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