From cf5115b9f9cce871e2414a238262b09e4afc56c2 Mon Sep 17 00:00:00 2001 From: Georg Koppen Date: Tue, 5 Dec 2017 19:35:47 +0000 Subject: [PATCH] Bug 21925: Don't compile with ASan and FORTIFY_SOURCE ASan and FORTIFY_SOURCE are not compatible with each other right now. Thus, we make sure that we have FORTIFY_SOURCE disabled in case the sanitizer is used. See #21925 for more details. --- build/autoconf/sanitize.m4 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build/autoconf/sanitize.m4 b/build/autoconf/sanitize.m4 index 3193d5c624cc9..272bf0cda69a3 100644 --- a/build/autoconf/sanitize.m4 +++ b/build/autoconf/sanitize.m4 @@ -32,8 +32,10 @@ if test -n "$MOZ_ASAN"; then CXXFLAGS="-fsanitize-blacklist=$_topsrcdir/build/sanitizers/asan_blacklist_win.txt $CXXFLAGS" fi fi - CFLAGS="-fsanitize=address $CFLAGS" - CXXFLAGS="-fsanitize=address $CXXFLAGS" + # ASan and FORTIFY_SOURCE are not compatible yet. Let's make sure we are + # compiling without FORTIFY_SOURCE if ASan is enabled, see #21925. + CFLAGS="-fsanitize=address $CFLAGS -U_FORTIFY_SOURCE" + CXXFLAGS="-fsanitize=address $CXXFLAGS -U_FORTIFY_SOURCE" if test -z "$CLANG_CL"; then LDFLAGS="-fsanitize=address $LDFLAGS" fi -- GitLab