diff --git a/build/autoconf/sanitize.m4 b/build/autoconf/sanitize.m4 index 74142a9142de..11fc6caebbd3 100644 --- a/build/autoconf/sanitize.m4 +++ b/build/autoconf/sanitize.m4 @@ -40,10 +40,6 @@ AC_SUBST(MOZ_ASAN) dnl ======================================================== dnl = Use Memory Sanitizer dnl ======================================================== -MOZ_ARG_ENABLE_BOOL(memory-sanitizer, -[ --enable-memory-sanitizer Enable Memory Sanitizer (default=no)], - MOZ_MSAN=1, - MOZ_MSAN= ) if test -n "$MOZ_MSAN"; then CFLAGS="-fsanitize=memory -fsanitize-memory-track-origins $CFLAGS" CXXFLAGS="-fsanitize=memory -fsanitize-memory-track-origins $CXXFLAGS" @@ -58,10 +54,6 @@ AC_SUBST(MOZ_MSAN) dnl ======================================================== dnl = Use Thread Sanitizer dnl ======================================================== -MOZ_ARG_ENABLE_BOOL(thread-sanitizer, -[ --enable-thread-sanitizer Enable Thread Sanitizer (default=no)], - MOZ_TSAN=1, - MOZ_TSAN= ) if test -n "$MOZ_TSAN"; then CFLAGS="-fsanitize=thread $CFLAGS" CXXFLAGS="-fsanitize=thread $CXXFLAGS" @@ -94,16 +86,6 @@ AC_SUBST(MOZ_UBSAN) dnl ======================================================== dnl = Use UndefinedBehavior Sanitizer to find integer overflows dnl ======================================================== - -MOZ_ARG_ENABLE_BOOL(signed-overflow-sanitizer, -[ --enable-signed-overflow-sanitizer Enable UndefinedBehavior Sanitizer (Signed Integer Overflow Parts, default=no)], - MOZ_SIGNED_OVERFLOW_SANITIZE=1, - MOZ_SIGNED_OVERFLOW_SANITIZE= ) -MOZ_ARG_ENABLE_BOOL(unsigned-overflow-sanitizer, -[ --enable-unsigned-overflow-sanitizer Enable UndefinedBehavior Sanitizer (Unsigned Integer Overflow Parts, default=no)], - MOZ_UNSIGNED_OVERFLOW_SANITIZE=1, - MOZ_UNSIGNED_OVERFLOW_SANITIZE= ) - if test -n "$MOZ_SIGNED_OVERFLOW_SANITIZE$MOZ_UNSIGNED_OVERFLOW_SANITIZE"; then MOZ_UBSAN=1 SANITIZER_BLACKLISTS="" diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure index c4ca5a494d31..043f59a20468 100644 --- a/build/moz.configure/old.configure +++ b/build/moz.configure/old.configure @@ -195,7 +195,6 @@ def old_configure_options(*options): '--enable-libproxy', '--enable-llvm-hacks', '--enable-logrefcnt', - '--enable-memory-sanitizer', '--enable-mobile-optimize', '--enable-necko-wifi', '--enable-negotiateauth', @@ -215,10 +214,7 @@ def old_configure_options(*options): '--enable-system-extension-dirs', '--enable-system-pixman', '--enable-system-sqlite', - '--enable-thread-sanitizer', - '--enable-signed-overflow-sanitizer', '--enable-universalchardet', - '--enable-unsigned-overflow-sanitizer', '--enable-updater', '--enable-xul', '--enable-zipwriter', diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure index c77ac5c3e11d..4f1e78c7c57a 100755 --- a/build/moz.configure/toolchain.configure +++ b/build/moz.configure/toolchain.configure @@ -1596,6 +1596,32 @@ def asan(): add_old_configure_assignment('MOZ_ASAN', asan) +# MSAN +# ============================================================== + +js_option('--enable-memory-sanitizer', help='Enable Memory Sanitizer') + + +@depends(when='--enable-memory-sanitizer') +def msan(): + return True + + +add_old_configure_assignment('MOZ_MSAN', msan) + +# TSAN +# ============================================================== + +js_option('--enable-thread-sanitizer', help='Enable Thread Sanitizer') + + +@depends(when='--enable-thread-sanitizer') +def tsan(): + return True + + +add_old_configure_assignment('MOZ_TSAN', tsan) + # UBSAN # ============================================================== @@ -1617,6 +1643,30 @@ def ubsan(options): add_old_configure_assignment('MOZ_UBSAN_CHECKS', ubsan) + +js_option('--enable-signed-overflow-sanitizer', + help='Enable UndefinedBehavior Sanitizer (Signed Integer Overflow Parts)') + + +@depends(when='--enable-signed-overflow-sanitizer') +def ub_signed_overflow_san(): + return True + + +add_old_configure_assignment('MOZ_SIGNED_OVERFLOW_SANITIZE', ub_signed_overflow_san) + + +js_option('--enable-unsigned-overflow-sanitizer', + help='Enable UndefinedBehavior Sanitizer (Unsigned Integer Overflow Parts)') + + +@depends(when='--enable-unsigned-overflow-sanitizer') +def ub_unsigned_overflow_san(): + return True + + +add_old_configure_assignment('MOZ_UNSIGNED_OVERFLOW_SANITIZE', ub_unsigned_overflow_san) + # Security Hardening # ==============================================================