Backed out 3 changesets (bug 1829049) for causing nightlyasrelease build bustage.

Backed out changeset 0dad03fea3eb (bug 1829049)
Backed out changeset 1350772f04de (bug 1829049)
Backed out changeset 2585980fa4fe (bug 1829049)
This commit is contained in:
Cosmin Sabou 2023-04-27 07:38:40 +03:00
parent 63c7c0f654
commit 566f69826b
7 changed files with 41 additions and 58 deletions

View File

@ -89,35 +89,23 @@ def main():
# alloc_fns contains all the vanilla allocation/free functions that we look
# for. Regexp chars are escaped appropriately.
operator_news = [
alloc_fns = [
# Matches |operator new(unsigned T)|, where |T| is |int| or |long|.
r"operator new(unsigned",
r"operator new\(unsigned",
# Matches |operator new[](unsigned T)|, where |T| is |int| or |long|.
r"operator new[](unsigned",
r"operator new\[\]\(unsigned",
r"memalign",
# These three aren't available on all Linux configurations.
# r'posix_memalign',
# r'aligned_alloc',
# r'valloc',
]
# operator new may end up inlined and replaced with moz_xmalloc.
inlined_operator_news = [
r"moz_xmalloc",
]
alloc_fns = (
operator_news
+ inlined_operator_news
+ [
r"memalign",
# These three aren't available on all Linux configurations.
# r'posix_memalign',
# r'aligned_alloc',
# r'valloc',
]
)
if args.aggressive:
alloc_fns += [r"malloc", r"calloc", r"realloc", r"free", r"strdup"]
# This is like alloc_fns, but regexp chars are not escaped.
alloc_fns_escaped = [re.escape(fn) for fn in alloc_fns]
alloc_fns_unescaped = [fn.replace("\\", "") for fn in alloc_fns]
# This regexp matches the relevant lines in the output of |nm|, which look
# like the following.
@ -125,8 +113,8 @@ def main():
# js/src/libjs_static.a:Utility.o: U malloc
# js/src/libjs_static.a:Utility.o: 00000000000007e0 T js::SetSourceOptions(...)
#
nm_line_re = re.compile(r"([^:/ ]+):\s*[0-9a-fA-F]*\s+([TUw]) (.*)")
alloc_fns_re = re.compile(r"|".join(alloc_fns_escaped))
nm_line_re = re.compile(r"([^:/ ]+):\s*[0-9a-fA-F]*\s+([TU]) (.*)")
alloc_fns_re = re.compile(r"|".join(alloc_fns))
# This tracks which allocation/free functions have been seen.
functions = defaultdict(set)
@ -214,24 +202,9 @@ def main():
# Check that all functions we expect are used in util/Utility.cpp. (This
# will fail if the function-detection code breaks at any point.)
# operator new and its inlined equivalent are mutually exclusive.
has_operator_news = any(fn in operator_news for fn in util_Utility_cpp)
has_inlined_operator_news = any(
fn in inlined_operator_news for fn in util_Utility_cpp
)
if has_operator_news and has_inlined_operator_news:
fail(
"Both operator new and moz_xmalloc aren't expected in util/Utility.cpp at the same time"
)
for fn in alloc_fns:
for fn in alloc_fns_unescaped:
if fn not in util_Utility_cpp:
if (
(fn in operator_news and not has_inlined_operator_news)
or (fn in inlined_operator_news and not has_operator_news)
or (fn not in operator_news and fn not in inlined_operator_news)
):
fail("'" + fn + "' isn't used as expected in util/Utility.cpp")
fail("'" + fn + "' isn't used as expected in util/Utility.cpp")
else:
util_Utility_cpp.remove(fn)
@ -267,9 +240,7 @@ def main():
#
# U malloc util/Utility.cpp:117
#
alloc_lines_re = (
r"[Uw] ((" + r"|".join(alloc_fns_escaped) + r").*)\s+(\S+:\d+)$"
)
alloc_lines_re = r"U ((" + r"|".join(alloc_fns) + r").*)\s+(\S+:\d+)$"
for line in lines:
m = re.search(alloc_lines_re, line)

View File

@ -919,8 +919,7 @@ void* AllocateMappedContent(int fd, size_t offset, size_t length,
HANDLE hFile = reinterpret_cast<HANDLE>(intptr_t(fd));
// This call will fail if the file does not exist.
HANDLE hMap =
CreateFileMappingW(hFile, nullptr, PAGE_READONLY, 0, 0, nullptr);
HANDLE hMap = CreateFileMapping(hFile, nullptr, PAGE_READONLY, 0, 0, nullptr);
if (!hMap) {
return nullptr;
}

View File

@ -282,7 +282,7 @@ static bool RegisterExecutableMemory(void* p, size_t bytes, size_t pageSize) {
// RtlAddGrowableFunctionTable is only available in Windows 8.1 and higher.
// This can be simplified if our compile target changes.
HMODULE ntdll_module =
LoadLibraryExW(L"ntdll.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
LoadLibraryEx("ntdll.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
static decltype(&::RtlAddGrowableFunctionTable) addGrowableFunctionTable =
reinterpret_cast<decltype(&::RtlAddGrowableFunctionTable)>(

View File

@ -543,6 +543,15 @@ 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

View File

@ -418,15 +418,15 @@ static bool ListDir(JSContext* cx, unsigned argc, Value* vp,
return false;
}
WIN32_FIND_DATAA FindFileData;
HANDLE hFind = FindFirstFileA(pattern.begin(), &FindFileData);
WIN32_FIND_DATA FindFileData;
HANDLE hFind = FindFirstFile(pattern.begin(), &FindFileData);
auto close = mozilla::MakeScopeExit([&] {
if (!FindClose(hFind)) {
MOZ_CRASH("Could not close Find");
}
});
for (bool found = (hFind != INVALID_HANDLE_VALUE); found;
found = FindNextFileA(hFind, &FindFileData)) {
found = FindNextFile(hFind, &FindFileData)) {
if (!append(FindFileData.cFileName)) {
return false;
}

View File

@ -125,6 +125,9 @@ 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 }'`
@ -173,6 +176,9 @@ 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 ========================================================
@ -597,6 +603,13 @@ 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

View File

@ -3314,12 +3314,3 @@ 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"]),
)