Bug 1418052 Used the wrong form for add_old_configure_assignment
MozReview-Commit-ID: 3s1l8zqd5vY
--- 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,
)