From 0c9f9432770596ec77a83f7a302c46108a651979 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 29 Aug 2018 20:06:00 +0100 Subject: build: Add a way to set CFLAGS for AddressSanitizer etc. We don't want to set these globally via the normal CFLAGS, because if we did, AddressSanitizer would catch test-segfault deliberately segfaulting, and "helpfully" turn it into exit status 1, which in turn makes our test fail because it asserts that the segfault is reported as a segfault. A typical use with gcc as compiler, on a reasonably recent Debian, would be: ./configure SANITIZE_CFLAGS="-fsanitize=address -fsanitize=undefined -fPIE -pie" Signed-off-by: Simon McVittie --- configure.ac | 3 +++ 1 file changed, 3 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 5723ae48..4636062a 100644 --- a/configure.ac +++ b/configure.ac @@ -1224,6 +1224,9 @@ CFLAGS="$EXTRA_CFLAGS $CFLAGS" CXXFLAGS="$EXTRA_CXXFLAGS $CXXFLAGS" LDFLAGS="$EXTRA_LDFLAGS $LDFLAGS" +AC_ARG_VAR([SANITIZE_CFLAGS], + [Extra CFLAGS for modules that are instrumented for error-checking]) + case $host_os in solaris*) # Solaris' C library apparently needs these runes to be threadsafe... -- cgit v1.2.1