Bug 1896066 - Move -ffunction-sections, -fdata-sections, -fno-exceptions and -fno-math-errno flag detection to moz.configure r=glandium

Differential Revision: https://phabricator.services.mozilla.com/D210036
This commit is contained in:
serge-sans-paille 2024-05-23 12:52:36 +00:00
parent 7cdf21c6de
commit 5047036a8a
2 changed files with 9 additions and 10 deletions

View file

@ -7,16 +7,6 @@ dnl Add compiler specific options
dnl A high level macro for selecting compiler options.
AC_DEFUN([MOZ_COMPILER_OPTS],
[
if test "$GNU_CC"; then
if test -z "$DEVELOPER_OPTIONS"; then
CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections"
fi
CFLAGS="$CFLAGS -fno-math-errno"
CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-math-errno"
fi
dnl ========================================================
dnl = Identical Code Folding
dnl ========================================================

View file

@ -11,6 +11,15 @@ check_and_add_flag("-fno-sized-deallocation", compiler=cxx_compiler)
# from the clang and GCC documentation, but they both support this.
check_and_add_flag("-fno-aligned-new", compiler=cxx_compiler)
with only_when(building_with_gnu_cc):
with only_when(~developer_options):
add_flag("-ffunction-sections")
add_flag("-fdata-sections")
add_flag("-fno-math-errno")
add_flag("-fno-exceptions", compiler=cxx_compiler)
# Please keep these last in this file.
add_old_configure_assignment("_COMPILATION_CFLAGS", compilation_flags.cflags)
add_old_configure_assignment("_COMPILATION_CXXFLAGS", compilation_flags.cxxflags)