зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1359908 Add FORTIFY_SOURCE to gcc and clang builds by default r=froydnj
This adds a section in both old-configure.in's for hardening flags. In old-configure.in we add $HARDENING_CFLAGS (which are turned on by --enable-hardening) and are defined in toolchain.configure (and which does compiler detection there.) We then add non-optional hardening flags, performing compiler detection here. In js/src/old-configure.in we follow the same pattern, but omit $HARDENING_CFLAGS because we don't apply the current lone flag to js (doing so is Bug 1359905). MozReview-Commit-ID: EFE0Pc7yZHa --HG-- extra : rebase_source : f793e665cabe3d33bdc73fc8a68208d69b55137a
This commit is contained in:
Родитель
3388320e33
Коммит
47a066f95e
|
@ -543,6 +543,15 @@ esac
|
|||
|
||||
MOZ_DOING_LTO(lto_is_enabled)
|
||||
|
||||
dnl ========================================================
|
||||
dnl Add optional and non-optional hardening flags
|
||||
dnl ========================================================
|
||||
if test "$GNU_CC" -o test -n "${CLANG_CC}${CLANG_CL}"; then
|
||||
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
|
||||
CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"
|
||||
CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2"
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl System overrides of the defaults for target
|
||||
dnl ========================================================
|
||||
|
|
|
@ -493,11 +493,19 @@ if test -n "$COMPILE_ENVIRONMENT"; then
|
|||
MOZ_CONFIG_SANITIZE
|
||||
fi
|
||||
|
||||
# Add the hardening flags from moz.configure
|
||||
dnl ========================================================
|
||||
dnl Add optional and non-optional hardening flags
|
||||
dnl ========================================================
|
||||
CFLAGS="$CFLAGS $HARDENING_CFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $HARDENING_CFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $HARDENING_CFLAGS"
|
||||
|
||||
if test "$GNU_CC" -o test -n "${CLANG_CC}${CLANG_CL}"; then
|
||||
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
|
||||
CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"
|
||||
CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2"
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl GNU specific defaults
|
||||
dnl ========================================================
|
||||
|
|
Загрузка…
Ссылка в новой задаче