From 0fab23d30b9f7aca08ec2c80b9d282cec8a0b5e9 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Thu, 27 Apr 2023 06:11:36 +0000 Subject: [PATCH] Bug 1829049 - Unambiguously enable STL wrapping on all platforms. r=firefox-build-system-reviewers,ahochheiden First, the setup in js/src/old-configure.in was actually doing nothing for js, since there weren't corresponding AC_SUBST/AC_SUBST_LIST. As mentioned in the commit message for bug 1274334, libmozglue contains operator new/operator delete overrides, so this didn't cause much harm, especially because js has limited use of plain operator new. Second, we take on the occasion to move the definitions to python configure. To match when the STL wrapping was enabled, we move it to toolkit/moz.configure, which is included by all Gecko-based projects, but explicitly not by standalone js (preserving its previous behavior, which is actually desirable for standalone js), and not by other projects such as tools/crashreporter/injects. Differential Revision: https://phabricator.services.mozilla.com/D175980 --- js/src/old-configure.in | 9 --------- old-configure.in | 13 ------------- toolkit/moz.configure | 9 +++++++++ 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/js/src/old-configure.in b/js/src/old-configure.in index e6b82e6840df..d9ac19c01c94 100644 --- a/js/src/old-configure.in +++ b/js/src/old-configure.in @@ -543,15 +543,6 @@ AC_LANG_CPLUSPLUS MOZ_CXX11 -case "${OS_TARGET}" in -WINNT|Darwin|Android) - ;; -*) - STL_FLAGS="-I${DIST}/stl_wrappers" - WRAP_STL_INCLUDES=1 - ;; -esac - dnl Checks for header files. dnl ======================================================== AC_HEADER_DIRENT diff --git a/old-configure.in b/old-configure.in index df8d394fbd9d..65c78a3b0cf0 100644 --- a/old-configure.in +++ b/old-configure.in @@ -125,9 +125,6 @@ case "$target" in fi WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && (pwd -W 2>/dev/null || pwd)` fi - - WRAP_STL_INCLUDES=1 - STL_FLAGS="-I${DIST}/stl_wrappers" else # Check w32api version _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'` @@ -176,9 +173,6 @@ fi # COMPILE_ENVIRONMENT AC_SUBST(GNU_CC) AC_SUBST(GNU_CXX) -AC_SUBST_LIST(STL_FLAGS) -AC_SUBST(WRAP_STL_INCLUDES) - dnl ======================================================== dnl set the defaults first dnl ======================================================== @@ -603,13 +597,6 @@ MOZ_CXX11 AC_LANG_C -STL_FLAGS="-I${DIST}/stl_wrappers" -WRAP_STL_INCLUDES=1 - -if test "$MOZ_BUILD_APP" = "tools/crashreporter/injector"; then - WRAP_STL_INCLUDES= -fi - dnl Checks for header files. dnl ======================================================== AC_HEADER_DIRENT diff --git a/toolkit/moz.configure b/toolkit/moz.configure index 996b0bc484ce..47c10080a7ee 100644 --- a/toolkit/moz.configure +++ b/toolkit/moz.configure @@ -3314,3 +3314,12 @@ option( ) set_config("MOZ_SYSTEM_POLICIES", True, when="--enable-system-policies") + + +# STL wrapping +# ============================================================== +set_config("WRAP_STL_INCLUDES", True) +set_config( + "STL_FLAGS", + depends(build_environment.dist)(lambda dist: [f"-I{dist}/stl_wrappers"]), +)