Bug 1835717 - Disable _FORTIFY_SOURCE by setting it to 0 rather than undefining it. r=tjr

Clang 17 made a change that made it an error to undefine _FORTIFY_SOURCE
on mac, because it's defined as a builtin when ASAN is enabled.
Defining it as 0 has the same effect of disabling it, but avoids the
error.

Differential Revision: https://phabricator.services.mozilla.com/D179398
This commit is contained in:
Mike Hommey 2023-05-30 19:59:29 +00:00
parent 28d473b72a
commit 4ae64cc3df

View File

@ -2459,9 +2459,9 @@ def security_hardening_cflags(
ldflags.append("-guard:cf,nolongjmp") ldflags.append("-guard:cf,nolongjmp")
# ---------------------------------------------------------- # ----------------------------------------------------------
# If ASAN _is_ on, undefine FORTIFY_SOURCE just to be safe # If ASAN _is_ on, disable FORTIFY_SOURCE just to be safe
if asan: if asan:
flags.append("-U_FORTIFY_SOURCE") flags.append("-D_FORTIFY_SOURCE=0")
# fno-common ----------------------------------------- # fno-common -----------------------------------------
# Do not merge variables for ASAN; can detect some subtle bugs # Do not merge variables for ASAN; can detect some subtle bugs