Bug 1418052 Used the wrong form for add_old_configure_assignment draft
authorTom Ritter <tom@mozilla.com>
Fri, 12 Jan 2018 23:56:24 -0600
changeset 720930 1540c7ccf19e86526a75b4d4d62c25b88e9a1e29
parent 720009 178f80714e6550468fbc9c4dcb8e26cdaa5e8446
child 721139 030f27bbe33c004e9211a97717344e0d5e52fa47
push id95694
push userbmo:tom@mozilla.com
push dateTue, 16 Jan 2018 15:20:08 +0000
bugs1418052
milestone59.0a1
Bug 1418052 Used the wrong form for add_old_configure_assignment MozReview-Commit-ID: 3s1l8zqd5vY
build/moz.configure/toolchain.configure
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -1295,23 +1295,24 @@ wine = check_prog('WINE', ['wine'], when
                   (lambda t, h: t.kernel == 'WINNT' and h.kernel == 'Linux'))
 
 # Security Hardening
 # ==============================================================
 
 js_option('--enable-address-sanitizer', help='Enable Address Sanitizer')
 
 
-@depends('--enable-address-sanitizer')
+@depends_if('--enable-address-sanitizer')
 def asan(value):
-    return value
+    return True
 
 
 add_old_configure_assignment('MOZ_ASAN', asan)
 
+
 option('--enable-hardening', env='MOZ_SECURITY_HARDENING',
        help='Enables security hardening compiler options')
 
 
 @depends('--enable-hardening', '--enable-address-sanitizer',
          '--enable-optimize', c_compiler, target)
 def security_hardening_cflags(hardening_flag, asan, optimize, c_compiler, target):
     compiler_is_gccish = c_compiler.type in ('gcc', 'clang')
@@ -1333,17 +1334,18 @@ def security_hardening_cflags(hardening_
             js_flags.append("-D_FORTIFY_SOURCE=2")
 
     # If ASAN _is_ on, undefine FOTIFY_SOURCE just to be safe
     if asan:
         flags.append("-U_FORTIFY_SOURCE")
         js_flags.append("-U_FORTIFY_SOURCE")
 
     # fstack-protector ------------------------------------
-    # Enable only if --enable-hardening is passed
+    # Enable only if --enable-hardening is passed and ASAN is
+    # not on as ASAN will catch the crashes for us
     if hardening_flag and compiler_is_gccish and not asan:
         flags.append("-fstack-protector-strong")
 
     return namespace(
         flags=flags,
         js_flags=js_flags,
     )