Skip to content
Snippets Groups Projects
Commit 566cf0b3 authored by Jeff King's avatar Jeff King Committed by Junio C Hamano
Browse files

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: default avatarJeff King <peff@peff.net>
Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
parent ddbc8a6d
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment