coreconf/sanitizers.mk
author Jed Davis <jld@mozilla.com>
Tue, 08 Mar 2016 09:58:54 -0800
changeset 11965 eba25272d2259b50321d5f8254820789d85ae4fd
parent 11950 47879a76b71a4cd7f3cd443480db7d2f26f38b18
child 12317 6c5f450d62304e685a75062f9f14a4dc45d9c8f0
permissions -rw-r--r--
Bug 1233568: Fix a few issues noticed after this landed. r=wtc. Specifically: * Use correct delimiter in ASAN_OPTIONS. * Variable name change (LDFLAGS vs. LFLAGS). * Unbreak Mac ASan build -- shlib linker flags were wrong.

# Address Sanitizer support; include this in OS-specific .mk files
# *after* defining the variables that are appended to here.

ifeq ($(USE_ASAN), 1)
SANITIZER_FLAGS_COMMON = -fsanitize=address $(EXTRA_SANITIZER_FLAGS)
SANITIZER_CFLAGS = $(SANITIZER_FLAGS_COMMON)
SANITIZER_LDFLAGS = $(SANITIZER_FLAGS_COMMON)
OS_CFLAGS += $(SANITIZER_CFLAGS)
LDFLAGS += $(SANITIZER_LDFLAGS)

# ASan needs frame pointers to save stack traces for allocation/free sites.
# (Warning: some platforms, like ARM Linux in Thumb mode, don't have useful
# frame pointers even with this option.)
SANITIZER_CFLAGS += -fno-omit-frame-pointer

# You probably want to be able to get debug info for failures, even with an
# optimized build.
OPTIMIZER += -g
endif