Backed out 2 changesets (bug 1906804, bug 1882553) for causing build bustages

Backed out changeset 1c8040b6090f (bug 1882553)
Backed out changeset f9fc828b8987 (bug 1906804)
This commit is contained in:
Cristina Horotan 2024-07-23 09:49:15 +03:00
parent 91fc17b0a3
commit c3b1e4aaa2
9 changed files with 126 additions and 125 deletions

1
aclocal.m4 vendored
View File

@ -7,6 +7,7 @@ builtin(include, build/autoconf/hooks.m4)dnl
builtin(include, build/autoconf/config.status.m4)dnl
builtin(include, build/autoconf/toolchain.m4)dnl
builtin(include, build/autoconf/altoptions.m4)dnl
builtin(include, build/autoconf/clang-plugin.m4)dnl
# Read the user's .mozconfig script. We can't do this in
# configure.in: autoconf puts the argument parsing code above anything

View File

@ -0,0 +1,46 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
AC_DEFUN([MOZ_CONFIG_CLANG_PLUGIN], [
if test -n "$ENABLE_CLANG_PLUGIN"; then
LLVM_CXXFLAGS=`$LLVM_CONFIG --cxxflags`
LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags | tr '\n' ' '`
if test "$HOST_OS_ARCH" = WINNT ; then
dnl Replace any backslashes from paths with forward slash.
LLVM_CXXFLAGS=$(echo "$LLVM_CXXFLAGS" | tr '\\' '/')
LLVM_LDFLAGS=$(echo "$LLVM_LDFLAGS" | tr '\\' '/')
fi
CLANG_PLUGIN_FLAGS="-Xclang -load -Xclang $CLANG_PLUGIN -Xclang -add-plugin -Xclang moz-check"
AC_DEFINE(MOZ_CLANG_PLUGIN)
fi
if test -n "$ENABLE_MOZSEARCH_PLUGIN"; then
if test -z "${ENABLE_CLANG_PLUGIN}"; then
AC_MSG_ERROR([Can't use mozsearch plugin without --enable-clang-plugin.])
fi
CLANG_PLUGIN_FLAGS="$CLANG_PLUGIN_FLAGS -Xclang -add-plugin -Xclang mozsearch-index"
dnl Parameters are: srcdir, outdir (path where output JSON is stored), objdir.
CLANG_PLUGIN_FLAGS="$CLANG_PLUGIN_FLAGS -Xclang -plugin-arg-mozsearch-index -Xclang $_topsrcdir"
CLANG_PLUGIN_FLAGS="$CLANG_PLUGIN_FLAGS -Xclang -plugin-arg-mozsearch-index -Xclang $_objdir/mozsearch_index"
CLANG_PLUGIN_FLAGS="$CLANG_PLUGIN_FLAGS -Xclang -plugin-arg-mozsearch-index -Xclang $_objdir"
AC_DEFINE(MOZ_MOZSEARCH_PLUGIN)
fi
AC_SUBST_LIST(CLANG_PLUGIN_FLAGS)
AC_SUBST_LIST(LLVM_CXXFLAGS)
AC_SUBST_LIST(LLVM_LDFLAGS)
AC_SUBST(ENABLE_CLANG_PLUGIN)
AC_SUBST(ENABLE_CLANG_PLUGIN_ALPHA)
AC_SUBST(ENABLE_MOZSEARCH_PLUGIN)
])

View File

@ -1,117 +0,0 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
@depends(host_library_name_info, build_environment, when="--enable-clang-plugin")
def clang_plugin_path(library_name_info, build_env):
topobjdir = build_env.topobjdir
if topobjdir.endswith("/js/src"):
topobjdir = topobjdir[:-7]
return os.path.abspath(
os.path.join(
topobjdir,
"build",
"clang-plugin",
"%sclang-plugin%s"
% (library_name_info.dll.prefix, library_name_info.dll.suffix),
)
)
set_config("CLANG_PLUGIN", clang_plugin_path)
option(
"--enable-clang-plugin-alpha",
env="ENABLE_CLANG_PLUGIN_ALPHA",
help="Enable static analysis with clang-plugin alpha checks.",
when="--enable-clang-plugin",
)
set_config("ENABLE_CLANG_PLUGIN_ALPHA", True, when="--enable-clang-plugin-alpha")
set_define("MOZ_CLANG_PLUGIN_ALPHA", True, when="--enable-clang-plugin-alpha")
option(
"--enable-mozsearch-plugin",
env="ENABLE_MOZSEARCH_PLUGIN",
help="Enable building with the mozsearch indexer plugin",
when="--enable-clang-plugin",
)
set_config("ENABLE_MOZSEARCH_PLUGIN", True, when="--enable-mozsearch-plugin")
set_define("MOZ_MOZSEARCH_PLUGIN", True, when="--enable-mozsearch-plugin")
@depends(
clang_plugin_path,
host,
llvm_config,
"--enable-mozsearch-plugin",
build_environment,
when="--enable-clang-plugin",
)
def clang_plugin_flags(
clang_plugin,
host,
llvm_config,
enable_mozsearch_plugin,
build_environment,
):
llvm_cxxflags = check_cmd_output(llvm_config, "--cxxflags").split()
llvm_ldflags = check_cmd_output(llvm_config, "--ldflags").replace("\n", " ").split()
if host.kernel == "WINNT":
# Replace any backslashes from paths with forward slash.
llvm_cxxflags = [arg.replace("\\", "/") for arg in llvm_cxxflags]
llvm_ldflags = [arg.replace("\\", "/") for arg in llvm_ldflags]
clang_plugin_flags = [
"-Xclang",
"-load",
"-Xclang",
clang_plugin,
"-Xclang",
"-add-plugin",
"-Xclang",
"moz-check",
]
if enable_mozsearch_plugin:
clang_plugin_flags.extend(
["-Xclang", "-add-plugin", "-Xclang", "mozsearch-index"]
)
# Parameters are: srcdir, outdir (path where output JSON is stored), objdir.
parameters = [
build_environment.topsrcdir,
os.path.join(build_environment.topobjdir, "mozsearch_index"),
build_environment.topobjdir,
]
for parameter in parameters:
clang_plugin_flags.extend(
["-Xclang", "-plugin-arg-mozsearch-index", "-Xclang", parameter]
)
return namespace(
plugin_flags=clang_plugin_flags,
llvm_cxxflags=llvm_cxxflags,
llvm_ldflags=llvm_ldflags,
)
set_config(
"CLANG_PLUGIN_FLAGS",
depends(clang_plugin_flags)(lambda plugin: plugin.plugin_flags if plugin else []),
)
set_config(
"LLVM_CXXFLAGS",
depends(clang_plugin_flags)(lambda plugin: plugin.llvm_cxxflags if plugin else []),
)
set_config(
"LLVM_LDFLAGS",
depends(clang_plugin_flags)(lambda plugin: plugin.llvm_ldflags if plugin else []),
)

View File

@ -712,7 +712,5 @@ set_config("HOST_CFLAGS", host_cflags)
set_config("HOST_CXXFLAGS", host_cxxflags)
set_config("HOST_LDFLAGS", host_ldflags)
set_config("OS_CPPFLAGS", os_cppflags)
set_config("OS_CFLAGS", os_cflags)
set_config("OS_CXXFLAGS", os_cxxflags)
set_config("ASFLAGS", os_asflags)
set_config("DSO_LDOPTS", dso_flags.ldopts)

View File

@ -3232,9 +3232,9 @@ option(
help="Enable building with the Clang plugin (gecko specific static analyzers)",
)
set_config("ENABLE_CLANG_PLUGIN", True, when="--enable-clang-plugin")
set_define("MOZ_CLANG_PLUGIN", True, when="--enable-clang-plugin")
add_old_configure_assignment(
"ENABLE_CLANG_PLUGIN", depends_if("--enable-clang-plugin")(lambda _: True)
)
@depends(host_c_compiler, c_compiler, when="--enable-clang-plugin")
@ -3309,6 +3309,34 @@ add_old_configure_assignment("LLVM_OBJDUMP", llvm_objdump)
# ==============================================================
add_flag("-TP", cxx_compiler, when=target_is_windows & ~building_with_gnu_compatible_cc)
option(
"--enable-clang-plugin-alpha",
env="ENABLE_CLANG_PLUGIN_ALPHA",
help="Enable static analysis with clang-plugin alpha checks.",
)
@depends("--enable-clang-plugin", "--enable-clang-plugin-alpha")
def check_clang_plugin_alpha(enable_clang_plugin, enable_clang_plugin_alpha):
if enable_clang_plugin_alpha:
if enable_clang_plugin:
return True
die("Cannot enable clang-plugin alpha checkers without --enable-clang-plugin.")
add_old_configure_assignment("ENABLE_CLANG_PLUGIN_ALPHA", check_clang_plugin_alpha)
set_define("MOZ_CLANG_PLUGIN_ALPHA", check_clang_plugin_alpha)
option(
"--enable-mozsearch-plugin",
env="ENABLE_MOZSEARCH_PLUGIN",
help="Enable building with the mozsearch indexer plugin",
)
add_old_configure_assignment(
"ENABLE_MOZSEARCH_PLUGIN", depends_if("--enable-mozsearch-plugin")(lambda _: True)
)
# Use the old libstdc++ ABI
# ==============================================================
add_flag(

1
js/src/aclocal.m4 vendored
View File

@ -7,6 +7,7 @@ builtin(include, ../../build/autoconf/hooks.m4)dnl
builtin(include, ../../build/autoconf/config.status.m4)dnl
builtin(include, ../../build/autoconf/toolchain.m4)dnl
builtin(include, ../../build/autoconf/altoptions.m4)dnl
builtin(include, ../../build/autoconf/clang-plugin.m4)dnl
define([__MOZ_AC_INIT_PREPARE], defn([AC_INIT_PREPARE]))
define([AC_INIT_PREPARE],

View File

@ -109,6 +109,14 @@ fi # COMPILE_ENVIRONMENT
AC_SUBST_LIST(MOZ_OPTIMIZE_FLAGS)
dnl ========================================================
dnl = Enable using the clang plugin to build
dnl ========================================================
if test -n "$COMPILE_ENVIRONMENT"; then
MOZ_CONFIG_CLANG_PLUGIN
fi # COMPILE_ENVIRONMENT
dnl ========================================================
dnl =
dnl = Maintainer debug option (no --enable equivalent)
@ -119,6 +127,11 @@ AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
AC_SUBST(MOZ_APP_DISPLAYNAME)
OS_CFLAGS="$CFLAGS"
OS_CXXFLAGS="$CXXFLAGS"
AC_SUBST_LIST(OS_CFLAGS)
AC_SUBST_LIST(OS_CXXFLAGS)
AC_SUBST(HOST_CC)
AC_SUBST(HOST_CXX)

View File

@ -560,9 +560,26 @@ set_config("MOZ_UI_LOCALE", depends("--enable-ui-locale")(lambda x: x))
# clang-plugin location
# ==============================================================
include(
"build/moz.configure/clang_plugin.configure", when="--enable-compile-environment"
)
@depends(host_library_name_info, build_environment, when="--enable-clang-plugin")
def clang_plugin_path(library_name_info, build_env):
topobjdir = build_env.topobjdir
if topobjdir.endswith("/js/src"):
topobjdir = topobjdir[:-7]
return os.path.abspath(
os.path.join(
topobjdir,
"build",
"clang-plugin",
"%sclang-plugin%s"
% (library_name_info.dll.prefix, library_name_info.dll.suffix),
)
)
set_config("CLANG_PLUGIN", clang_plugin_path)
add_old_configure_assignment("CLANG_PLUGIN", clang_plugin_path)
# Awk detection

View File

@ -153,6 +153,15 @@ fi # COMPILE_ENVIRONMENT
AC_SUBST_LIST(MOZ_OPTIMIZE_FLAGS)
dnl ========================================================
dnl = Enable using the clang plugin to build
dnl ========================================================
if test -n "$COMPILE_ENVIRONMENT"; then
MOZ_CONFIG_CLANG_PLUGIN
fi # COMPILE_ENVIRONMENT
AC_LANG_C
dnl ========================================================
dnl = Mac bundle name
@ -252,6 +261,11 @@ AC_DEFINE_UNQUOTED(MOZ_APP_UA_VERSION, "$MOZ_APP_VERSION")
AC_SUBST(MOZ_APP_MAXVERSION)
OS_CFLAGS="$CFLAGS"
OS_CXXFLAGS="$CXXFLAGS"
AC_SUBST_LIST(OS_CFLAGS)
AC_SUBST_LIST(OS_CXXFLAGS)
AC_SUBST(HOST_CC)
AC_SUBST(HOST_CXX)