Commit 565a48a8 authored by Georg Koppen's avatar Georg Koppen
Browse files

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.
parent 4328aa6c
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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