Bug 1557583 - Move --enable-*-sanitizers options to python configure. r=dmajor
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 07 Jun 2019 13:08:27 +0000
changeset 478546 715849d7c913f8b9698f1d4e7584959ad043f5d9
parent 478545 4778e168c9acc7a7400efbe01d12500e8032db87
child 478547 f0f958b29d69ceaa0faa34955e98c63ecd94af7b
push id36145
push useraciure@mozilla.com
push dateThu, 13 Jun 2019 03:50:31 +0000
treeherdermozilla-central@4a63f0a3a1f2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmajor
bugs1557583
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1557583 - Move --enable-*-sanitizers options to python configure. r=dmajor But keep the corresponding logic in sanitize.m4. Differential Revision: https://phabricator.services.mozilla.com/D34116
build/autoconf/sanitize.m4
build/moz.configure/old.configure
build/moz.configure/toolchain.configure
--- a/build/autoconf/sanitize.m4
+++ b/build/autoconf/sanitize.m4
@@ -35,38 +35,30 @@ if test -n "$MOZ_ASAN"; then
     AC_DEFINE(MOZ_ASAN)
     MOZ_PATH_PROG(LLVM_SYMBOLIZER, llvm-symbolizer)
 fi
 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"
     if test -z "$CLANG_CL"; then
         LDFLAGS="-fsanitize=memory -fsanitize-memory-track-origins -rdynamic $LDFLAGS"
     fi
     AC_DEFINE(MOZ_MSAN)
     MOZ_PATH_PROG(LLVM_SYMBOLIZER, llvm-symbolizer)
 fi
 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"
     if test -z "$CLANG_CL"; then
         LDFLAGS="-fsanitize=thread -rdynamic $LDFLAGS"
     fi
     AC_DEFINE(MOZ_TSAN)
     MOZ_PATH_PROG(LLVM_SYMBOLIZER, llvm-symbolizer)
@@ -89,26 +81,16 @@ if test -n "$MOZ_UBSAN_CHECKS"; then
     AC_DEFINE(MOZ_UBSAN)
     MOZ_PATH_PROG(LLVM_SYMBOLIZER, llvm-symbolizer)
 fi
 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=""
     if test -n "$MOZ_SIGNED_OVERFLOW_SANITIZE"; then
         SANITIZER_BLACKLISTS="-fsanitize-blacklist=$_topsrcdir/build/sanitizers/ubsan_signed_overflow_blacklist.txt $SANITIZER_BLACKLISTS"
         CFLAGS="-fsanitize=signed-integer-overflow $CFLAGS"
         CXXFLAGS="-fsanitize=signed-integer-overflow $CXXFLAGS"
         if test -z "$CLANG_CL"; then
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -190,17 +190,16 @@ def old_configure_options(*options):
     '--enable-gconf',
     '--enable-icf',
     '--enable-install-strip',
     '--enable-ios-target',
     '--enable-libjpeg-turbo',
     '--enable-libproxy',
     '--enable-llvm-hacks',
     '--enable-logrefcnt',
-    '--enable-memory-sanitizer',
     '--enable-mobile-optimize',
     '--enable-necko-wifi',
     '--enable-negotiateauth',
     '--enable-nfc',
     '--enable-nspr-build',
     '--enable-official-branding',
     '--enable-parental-controls',
     '--enable-pref-extensions',
@@ -210,20 +209,17 @@ def old_configure_options(*options):
     '--enable-startup-notification',
     '--enable-startupcache',
     '--enable-strip',
     '--enable-synth-pico',
     '--enable-system-cairo',
     '--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',
     '--includedir',
     '--libdir',
     '--prefix',
     '--with-android-distribution-directory',
     '--with-android-max-sdk',
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -1591,16 +1591,42 @@ js_option('--enable-address-sanitizer', 
 
 @depends(when='--enable-address-sanitizer')
 def asan():
     return True
 
 
 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
 # ==============================================================
 
 js_option('--enable-undefined-sanitizer',
           nargs='*',
           help='Enable UndefinedBehavior Sanitizer')
 
 @depends_if('--enable-undefined-sanitizer')
@@ -1612,16 +1638,40 @@ def ubsan(options):
     ]
 
     checks = options if len(options) else default_checks
 
     return ','.join(checks)
 
 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
 # ==============================================================
 
 option('--enable-hardening', env='MOZ_SECURITY_HARDENING',
        help='Enables security hardening compiler options')
 
 
 # This function is a bit confusing. It adds or removes hardening flags in