sm-commit AT lists.ibiblio.org
Subject: Source Mage code commit list
List archive
[SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (dd3f83a2cbe295439f4ee1d484873e1d4680a1bb)
- From: Pavel Vinogradov <scm AT sourcemage.org>
- To: sm-commit AT lists.ibiblio.org
- Subject: [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (dd3f83a2cbe295439f4ee1d484873e1d4680a1bb)
- Date: Mon, 7 Aug 2023 19:06:27 +0000
GIT changes to master grimoire by Pavel Vinogradov <public AT sourcemage.org>:
http/firefox/DETAILS
| 2
http/firefox/HISTORY
| 4
http/firefox/patches/0030-bmo-1847190-dont-use-configure_cache-for-relative-relocations.patch
| 43
http/firefox/patches/0031-bmo-1841567-stop-running-check_binary-on-host-binaries.patch
| 431 ++++++++++
http/firefox/patches/0032-bmo-1841571-treat-rust-libraries-as-objects.patch
| 102 ++
http/firefox/patches/0033-bmo-1844484-override-compiler-vtables-symbol-for-pure-virtual-methods.patch
| 150 +++
http/firefox/patches/0034-bgo-911679-gcc-binutils-2.41.patch
| 60 +
7 files changed, 791 insertions(+), 1 deletion(-)
New commits:
commit dd3f83a2cbe295439f4ee1d484873e1d4680a1bb
Author: Pavel Vinogradov <public AT sourcemage.org>
Commit: Pavel Vinogradov <public AT sourcemage.org>
http/firefox: version 116.0.2
diff --git a/http/firefox/DETAILS b/http/firefox/DETAILS
index a06bf5b..4dd40a0 100755
--- a/http/firefox/DETAILS
+++ b/http/firefox/DETAILS
@@ -1,5 +1,5 @@
SPELL=firefox
- VERSION=116.0.1
+ VERSION=116.0.2
SECURITY_PATCH=180
SOURCE="${SPELL}-${VERSION}.source.tar.xz"
# Watch: http://releases.mozilla.org/pub/firefox/releases/
/releases/([0-9.]+)/
diff --git a/http/firefox/HISTORY b/http/firefox/HISTORY
index a070183..4bb26b0 100644
--- a/http/firefox/HISTORY
+++ b/http/firefox/HISTORY
@@ -1,3 +1,7 @@
+2023-08-07 Pavel Vinogradov <public AT sourcemage.org>
+ * DETAILS: version 116.0.2
+ * patches/*: updated
+
2023-08-06 Pavel Vinogradov <public AT sourcemage.org>
* DETAILS: version 116.0.1
diff --git
a/http/firefox/patches/0030-bmo-1847190-dont-use-configure_cache-for-relative-relocations.patch
b/http/firefox/patches/0030-bmo-1847190-dont-use-configure_cache-for-relative-relocations.patch
new file mode 100644
index 0000000..e95d909
--- /dev/null
+++
b/http/firefox/patches/0030-bmo-1847190-dont-use-configure_cache-for-relative-relocations.patch
@@ -0,0 +1,43 @@
+diff -Naur a/build/moz.configure/util.configure
b/build/moz.configure/util.configure
+--- a/build/moz.configure/util.configure 2023-08-07 09:25:05.036606566
-0000
++++ b/build/moz.configure/util.configure 2023-08-07 11:16:45.797899734
-0000
+@@ -217,9 +217,9 @@
+ ):
+ compiler_path = compiler[0]
+ compiler = wrapper + compiler
+- use_cache = True
++ use_cache = configure_cache is not None
+
+- if compiler_path not in configure_cache.version_checked_compilers:
++ if use_cache and compiler_path not in
configure_cache.version_checked_compilers:
+ try:
+ version_info = subprocess.check_output(
+ [compiler_path, "--version"],
+diff -Naur a/toolkit/moz.configure b/toolkit/moz.configure
+--- a/toolkit/moz.configure 2023-08-07 09:25:00.818403536 -0000
++++ b/toolkit/moz.configure 2023-08-07 11:17:44.794947991 -0000
+@@ -1618,7 +1618,6 @@
+ extra_toolchain_flags,
+ linker_ldflags,
+ readelf,
+- configure_cache,
+ when=may_use_pack_relative_relocs,
+ )
+ @checking("for -z pack-relative-relocs option to ld", bool)
+@@ -1631,7 +1630,6 @@
+ extra_toolchain_flags,
+ linker_ldflags,
+ readelf,
+- configure_cache,
+ ):
+ try:
+ fd, path = mkstemp(prefix="conftest.")
+@@ -1640,7 +1638,7 @@
+ pack_rel_relocs = ["-Wl,-z,pack-relative-relocs"]
+ if (
+ try_invoke_compiler(
+- configure_cache,
++ None,
+ [c_compiler.compiler] + c_compiler.flags,
+ c_compiler.language,
+ "int main() { return 0; }",
diff --git
a/http/firefox/patches/0031-bmo-1841567-stop-running-check_binary-on-host-binaries.patch
b/http/firefox/patches/0031-bmo-1841567-stop-running-check_binary-on-host-binaries.patch
new file mode 100644
index 0000000..0c6c69a
--- /dev/null
+++
b/http/firefox/patches/0031-bmo-1841567-stop-running-check_binary-on-host-binaries.patch
@@ -0,0 +1,431 @@
+
+# HG changeset patch
+# User Mike Hommey <mh+mozilla AT glandium.org>
+# Date 1688543450 0
+# Node ID aec57c7faed9d7639d7e1fbd936a8b38bc747e63
+# Parent 38b13df05dd40dab0cd1eaba4f7248de589d99e8
+Bug 1841567 - Stop running check_binary on host binaries.
r=firefox-build-system-reviewers,sergesanspaille
+
+Back when this was added, we weren't using sysroots, and we did end up
+with host binaries that couldn't run on the host because libstdc++ came
+along the host compiler, and was newer than the system libstdc++. These
+concerns are long gone (libstdc++ in the sysroots is older than any
+supported linux host build system), so we don't need to run those checks
+anymore.
+
+Differential Revision: https://phabricator.services.mozilla.com/D182691
+
+diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk
+--- a/config/makefiles/rust.mk
++++ b/config/makefiles/rust.mk
+@@ -442,17 +442,17 @@ RUST_LIBRARY_DEPS := $(wordlist 2, 10000
+ # the chance of proxy bypasses originating from rust code.
+ # The check only works when rust code is built with -Clto but without
MOZ_LTO_RUST_CROSS.
+ # Sanitizers and sancov also fail because compiler-rt hooks network
functions.
+ ifndef MOZ_PROFILE_GENERATE
+ ifeq ($(OS_ARCH), Linux)
+ ifeq (,$(rustflags_sancov)$(MOZ_ASAN)$(MOZ_TSAN)$(MOZ_UBSAN))
+ ifndef MOZ_LTO_RUST_CROSS
+ ifneq (,$(filter -Clto,$(cargo_rustc_flags)))
+- $(call py_action,check_binary,--target --networking $@)
++ $(call py_action,check_binary,--networking $@)
+ endif
+ endif
+ endif
+ endif
+ endif
+
+ define make_default_rule
+ $(1):
+diff --git a/config/rules.mk b/config/rules.mk
+--- a/config/rules.mk
++++ b/config/rules.mk
+@@ -417,17 +417,17 @@ endef
+ # creates OBJS, links with LIBS to create Foo
+ #
+ $(PROGRAM): $(PROGOBJS) $(STATIC_LIBS) $(EXTRA_DEPS) $(call
resfile,$(PROGRAM)) $(GLOBAL_DEPS) $(call mkdir_deps,$(FINAL_TARGET))
+ $(REPORT_BUILD)
+ ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
+ $(LINKER) -OUT:$@ -PDB:$(LINK_PDBFILE) -IMPLIB:$(basename $(@F)).lib
$(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_PROGRAM_LDFLAGS) $($(notdir $@)_OBJS)
$(filter %.res,$^) $(STATIC_LIBS) $(SHARED_LIBS) $(OS_LIBS)
+ else # !WINNT || GNU_CC
+ $(call EXPAND_CC_OR_CXX,$@) -o $@ $(COMPUTED_CXX_LDFLAGS)
$(PGO_CFLAGS) $($(notdir $@)_OBJS) $(filter %.res,$^) $(WIN32_EXE_LDFLAGS)
$(LDFLAGS) $(STATIC_LIBS) $(MOZ_PROGRAM_LDFLAGS) $(SHARED_LIBS) $(OS_LIBS)
+- $(call py_action,check_binary,--target $@)
++ $(call py_action,check_binary,$@)
+ endif # WINNT && !GNU_CC
+
+ ifdef ENABLE_STRIP
+ $(STRIP) $(STRIP_FLAGS) $@
+ endif
+ ifdef MOZ_POST_PROGRAM_COMMAND
+ $(MOZ_POST_PROGRAM_COMMAND) $@
+ endif
+@@ -438,19 +438,16 @@ ifeq (_WINNT,$(GNU_CC)_$(HOST_OS_ARCH))
+ $(HOST_LINKER) -OUT:$@ -PDB:$(HOST_PDBFILE) $($(notdir $@)_OBJS)
$(WIN32_EXE_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LINKER_LIBPATHS) $(HOST_LIBS)
$(HOST_EXTRA_LIBS)
+ else
+ ifeq ($(HOST_CPP_PROG_LINK),1)
+ $(HOST_CXX) -o $@ $(HOST_CXX_LDFLAGS) $(HOST_LDFLAGS) $($(notdir
$@)_OBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
+ else
+ $(HOST_CC) -o $@ $(HOST_C_LDFLAGS) $(HOST_LDFLAGS) $($(notdir
$@)_OBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
+ endif # HOST_CPP_PROG_LINK
+ endif
+-ifndef CROSS_COMPILE
+- $(call py_action,check_binary,--host $@)
+-endif
+
+ #
+ # This is an attempt to support generation of multiple binaries
+ # in one directory, it assumes everything to compile Foo is in
+ # Foo.o (from either Foo.c or Foo.cpp).
+ #
+ # SIMPLE_PROGRAMS = Foo Bar
+ # creates Foo.o Bar.o, links with LIBS to create Foo, Bar.
+@@ -461,17 +458,17 @@ endef
+ $(foreach p,$(SIMPLE_PROGRAMS),$(eval $(call simple_program_deps,$(p))))
+
+ $(SIMPLE_PROGRAMS):
+ $(REPORT_BUILD)
+ ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
+ $(LINKER) -out:$@ -pdb:$(LINK_PDBFILE) $($@_OBJS) $(filter %.res,$^)
$(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_PROGRAM_LDFLAGS) $(STATIC_LIBS)
$(SHARED_LIBS) $(OS_LIBS)
+ else
+ $(call EXPAND_CC_OR_CXX,$@) $(COMPUTED_CXX_LDFLAGS) $(PGO_CFLAGS) -o
$@ $($@_OBJS) $(filter %.res,$^) $(WIN32_EXE_LDFLAGS) $(LDFLAGS)
$(STATIC_LIBS) $(MOZ_PROGRAM_LDFLAGS) $(SHARED_LIBS) $(OS_LIBS)
+- $(call py_action,check_binary,--target $@)
++ $(call py_action,check_binary,$@)
+ endif # WINNT && !GNU_CC
+
+ ifdef ENABLE_STRIP
+ $(STRIP) $(STRIP_FLAGS) $@
+ endif
+ ifdef MOZ_POST_PROGRAM_COMMAND
+ $(MOZ_POST_PROGRAM_COMMAND) $@
+ endif
+@@ -482,19 +479,16 @@ ifeq (WINNT_,$(HOST_OS_ARCH)_$(GNU_CC))
+ $(HOST_LINKER) -OUT:$@ -PDB:$(HOST_PDBFILE) $($(notdir $@)_OBJS)
$(WIN32_EXE_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LINKER_LIBPATHS) $(HOST_LIBS)
$(HOST_EXTRA_LIBS)
+ else
+ ifneq (,$(HOST_CPPSRCS)$(USE_HOST_CXX))
+ $(HOST_CXX) $(HOST_OUTOPTION)$@ $(HOST_CXX_LDFLAGS) $(HOST_LDFLAGS)
$($(notdir $@)_OBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
+ else
+ $(HOST_CC) $(HOST_OUTOPTION)$@ $(HOST_C_LDFLAGS) $(HOST_LDFLAGS)
$($(notdir $@)_OBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
+ endif
+ endif
+-ifndef CROSS_COMPILE
+- $(call py_action,check_binary,--host $@)
+-endif
+
+ $(LIBRARY): $(OBJS) $(STATIC_LIBS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
+ $(REPORT_BUILD)
+ $(RM) $(REAL_LIBRARY)
+ $(AR) $(AR_FLAGS) $($@_OBJS)
+
+ $(WASM_ARCHIVE): $(CWASMOBJS) $(CPPWASMOBJS) $(STATIC_LIBS) $(EXTRA_DEPS)
$(GLOBAL_DEPS)
+ $(REPORT_BUILD_VERBOSE)
+@@ -525,17 +519,17 @@ endif
+ # so instead of deleting .o files after repacking them into a dylib, we make
+ # symlinks back to the originals. The symlinks are a no-op for stabs
debugging,
+ # so no need to conditionalize on OS version or debugging format.
+
+ $(SHARED_LIBRARY): $(OBJS) $(call resfile,$(SHARED_LIBRARY)) $(STATIC_LIBS)
$(EXTRA_DEPS) $(GLOBAL_DEPS)
+ $(REPORT_BUILD)
+ $(RM) $@
+ $(MKSHLIB) $($@_OBJS) $(filter %.res,$^) $(LDFLAGS) $(STATIC_LIBS)
$(SHARED_LIBS) $(EXTRA_DSO_LDOPTS) $(MOZ_GLUE_LDFLAGS) $(OS_LIBS)
+- $(call py_action,check_binary,--target $@)
++ $(call py_action,check_binary,$@)
+
+ ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
+ endif # WINNT && !GCC
+ chmod +x $@
+ ifdef ENABLE_STRIP
+ $(STRIP) $(STRIP_FLAGS) $@
+ endif
+
+diff --git a/python/mozbuild/mozbuild/action/check_binary.py
b/python/mozbuild/mozbuild/action/check_binary.py
+--- a/python/mozbuild/mozbuild/action/check_binary.py
++++ b/python/mozbuild/mozbuild/action/check_binary.py
+@@ -15,22 +15,18 @@ from packaging.version import Version
+ from mozbuild.action.util import log_build_task
+ from mozbuild.util import memoize
+
+ STDCXX_MAX_VERSION = Version("3.4.19")
+ CXXABI_MAX_VERSION = Version("1.3.7")
+ GLIBC_MAX_VERSION = Version("2.17")
+ LIBGCC_MAX_VERSION = Version("4.8")
+
+-HOST = {"platform": buildconfig.substs["HOST_OS_ARCH"], "readelf":
"readelf"}
+-
+-TARGET = {
+- "platform": buildconfig.substs["OS_TARGET"],
+- "readelf": buildconfig.substs.get("READELF", "readelf"),
+-}
++PLATFORM = buildconfig.substs["OS_TARGET"]
++READELF = buildconfig.substs.get("READELF", "readelf")
+
+ ADDR_RE = re.compile(r"[0-9a-f]{8,16}")
+
+ if buildconfig.substs.get("HAVE_64BIT_BUILD"):
+ GUESSED_NSMODULE_SIZE = 8
+ else:
+ GUESSED_NSMODULE_SIZE = 4
+
+@@ -58,24 +54,24 @@ def at_least_one(iter):
+ for item in iter:
+ saw_one = True
+ yield item
+ if not saw_one:
+ raise Empty()
+
+
+ # Iterates the symbol table on ELF binaries.
+-def iter_elf_symbols(target, binary, all=False):
++def iter_elf_symbols(binary, all=False):
+ ty = get_type(binary)
+ # Static libraries are ar archives. Assume they are ELF.
+ if ty == UNKNOWN and open(binary, "rb").read(8) == b"!<arch>\n":
+ ty = ELF
+ assert ty == ELF
+ for line in get_output(
+- target["readelf"], "--wide", "--syms" if all else "--dyn-syms",
binary
++ READELF, "--wide", "--syms" if all else "--dyn-syms", binary
+ ):
+ data = line.split()
+ if not (len(data) >= 8 and data[0].endswith(":") and
data[0][:-1].isdigit()):
+ continue
+ n, addr, size, type, bind, vis, index, name = data[:8]
+
+ if "@" in name:
+ name, ver = name.rsplit("@", 1)
+@@ -88,36 +84,36 @@ def iter_elf_symbols(target, binary, all
+ # readelf output may contain decimal values or hexadecimal
+ # values prefixed with 0x for the size. Let python autodetect.
+ "size": int(size, 0),
+ "name": name,
+ "version": ver,
+ }
+
+
+-def iter_readelf_dynamic(target, binary):
+- for line in get_output(target["readelf"], "-d", binary):
++def iter_readelf_dynamic(binary):
++ for line in get_output(READELF, "-d", binary):
+ data = line.split(None, 2)
+ if data and len(data) == 3 and data[0].startswith("0x"):
+ yield data[1].rstrip(")").lstrip("("), data[2]
+
+
+-def check_binary_compat(target, binary):
++def check_binary_compat(binary):
+ if get_type(binary) != ELF:
+ raise Skip()
+ checks = (
+ ("libstdc++", "GLIBCXX_", STDCXX_MAX_VERSION),
+ ("libstdc++", "CXXABI_", CXXABI_MAX_VERSION),
+ ("libgcc", "GCC_", LIBGCC_MAX_VERSION),
+ ("libc", "GLIBC_", GLIBC_MAX_VERSION),
+ )
+
+ unwanted = {}
+ try:
+- for sym in at_least_one(iter_elf_symbols(target, binary)):
++ for sym in at_least_one(iter_elf_symbols(binary)):
+ # Only check versions on undefined symbols
+ if sym["addr"] != 0:
+ continue
+
+ # No version to check
+ if not sym["version"]:
+ continue
+
+@@ -136,21 +132,21 @@ def check_binary_compat(target, binary):
+ "We do not want these {} symbol versions to be
used:".format(lib)
+ )
+ error.extend(
+ " {} ({})".format(s["name"], s["version"]) for s in
unwanted[prefix]
+ )
+ raise RuntimeError("\n".join(error))
+
+
+-def check_textrel(target, binary):
+- if target is HOST or get_type(binary) != ELF:
++def check_textrel(binary):
++ if get_type(binary) != ELF:
+ raise Skip()
+ try:
+- for tag, value in at_least_one(iter_readelf_dynamic(target,
binary)):
++ for tag, value in at_least_one(iter_readelf_dynamic(binary)):
+ if tag == "TEXTREL" or (tag == "FLAGS" and "TEXTREL" in value):
+ raise RuntimeError(
+ "We do not want text relocations in libraries and
programs"
+ )
+ except Empty:
+ raise RuntimeError("Could not parse readelf output?")
+
+
+@@ -162,54 +158,52 @@ def ishex(s):
+ return False
+
+
+ def is_libxul(binary):
+ basename = os.path.basename(binary).lower()
+ return "xul" in basename
+
+
+-def check_pt_load(target, binary):
+- if target is HOST or get_type(binary) != ELF or not is_libxul(binary):
++def check_pt_load(binary):
++ if get_type(binary) != ELF or not is_libxul(binary):
+ raise Skip()
+ count = 0
+- for line in get_output(target["readelf"], "-l", binary):
++ for line in get_output(READELF, "-l", binary):
+ data = line.split()
+ if data and data[0] == "LOAD":
+ count += 1
+ if count <= 1:
+ raise RuntimeError("Expected more than one PT_LOAD segment")
+
+
+-def check_mozglue_order(target, binary):
+- if target is HOST or target["platform"] != "Android":
++def check_mozglue_order(binary):
++ if PLATFORM != "Android":
+ raise Skip()
+ # While this is very unlikely (libc being added by the compiler at the
end
+ # of the linker command line), if libmozglue.so ends up after libc.so,
all
+ # hell breaks loose, so better safe than sorry, and check it's actually
the
+ # case.
+ try:
+ mozglue = libc = None
+- for n, (tag, value) in enumerate(
+- at_least_one(iter_readelf_dynamic(target, binary))
+- ):
++ for n, (tag, value) in
enumerate(at_least_one(iter_readelf_dynamic(binary))):
+ if tag == "NEEDED":
+ if "[libmozglue.so]" in value:
+ mozglue = n
+ elif "[libc.so]" in value:
+ libc = n
+ if libc is None:
+ raise RuntimeError("libc.so is not linked?")
+ if mozglue is not None and libc < mozglue:
+ raise RuntimeError("libmozglue.so must be linked before
libc.so")
+ except Empty:
+ raise RuntimeError("Could not parse readelf output?")
+
+
+-def check_networking(target, binary):
++def check_networking(binary):
+ retcode = 0
+ networking_functions = set(
+ [
+ # socketpair is not concerning; it is restricted to AF_UNIX
+ "connect",
+ "accept",
+ "listen",
+ "getsockname",
+@@ -237,17 +231,17 @@ def check_networking(target, binary):
+ "getprotobynumber",
+ "setprotoent",
+ "endprotoent",
+ ]
+ )
+ bad_occurences_names = set()
+
+ try:
+- for sym in at_least_one(iter_elf_symbols(target, binary, all=True)):
++ for sym in at_least_one(iter_elf_symbols(binary, all=True)):
+ if sym["addr"] == 0 and sym["name"] in networking_functions:
+ bad_occurences_names.add(sym["name"])
+ except Empty:
+ raise RuntimeError("Could not parse llvm-objdump output?")
+
+ basename = os.path.basename(binary)
+ if bad_occurences_names:
+ s = (
+@@ -263,37 +257,37 @@ def check_networking(target, binary):
+ file=sys.stderr,
+ )
+ retcode = 1
+ elif buildconfig.substs.get("MOZ_AUTOMATION"):
+ print("TEST-PASS | check_networking | {}".format(basename))
+ return retcode
+
+
+-def checks(target, binary):
++def checks(binary):
+ # The clang-plugin is built as target but is really a host binary.
+- # Cheat and pretend we were passed the right argument.
++ # Cheat and pretend we weren't called.
+ if "clang-plugin" in binary:
+- target = HOST
++ return 0
+ checks = []
+- if buildconfig.substs.get("MOZ_STDCXX_COMPAT") and target["platform"]
== "Linux":
++ if buildconfig.substs.get("MOZ_STDCXX_COMPAT") and PLATFORM == "Linux":
+ checks.append(check_binary_compat)
+
+ # Disabled for local builds because of readelf performance: See bug
1472496
+ if not buildconfig.substs.get("DEVELOPER_OPTIONS"):
+ checks.append(check_textrel)
+ checks.append(check_pt_load)
+ checks.append(check_mozglue_order)
+
+ retcode = 0
+ basename = os.path.basename(binary)
+ for c in checks:
+ try:
+ name = c.__name__
+- c(target, binary)
++ c(binary)
+ if buildconfig.substs.get("MOZ_AUTOMATION"):
+ print("TEST-PASS | {} | {}".format(name, basename))
+ except Skip:
+ pass
+ except RuntimeError as e:
+ print(
+ "TEST-UNEXPECTED-FAIL | {} | {} | {}".format(name,
basename, str(e)),
+ file=sys.stderr,
+@@ -301,43 +295,26 @@ def checks(target, binary):
+ retcode = 1
+ return retcode
+
+
+ def main(args):
+ parser = argparse.ArgumentParser(description="Check built binaries")
+
+ parser.add_argument(
+- "--host", action="store_true", help="Perform checks for a host
binary"
+- )
+- parser.add_argument(
+- "--target", action="store_true", help="Perform checks for a target
binary"
+- )
+- parser.add_argument(
+ "--networking",
+ action="store_true",
+ help="Perform checks for networking functions",
+ )
+
+ parser.add_argument(
+ "binary", metavar="PATH", help="Location of the binary to check"
+ )
+
+ options = parser.parse_args(args)
+
+- if options.host == options.target:
+- print("Exactly one of --host or --target must be given",
file=sys.stderr)
+- return 1
+-
+- if options.networking and options.host:
+- print("--networking is only valid with --target", file=sys.stderr)
+- return 1
+-
+ if options.networking:
+- return check_networking(TARGET, options.binary)
+- elif options.host:
+- return checks(HOST, options.binary)
+- elif options.target:
+- return checks(TARGET, options.binary)
++ return check_networking(options.binary)
++ return checks(options.binary)
+
+
+ if __name__ == "__main__":
+ sys.exit(log_build_task(main, sys.argv[1:]))
+
diff --git
a/http/firefox/patches/0032-bmo-1841571-treat-rust-libraries-as-objects.patch
b/http/firefox/patches/0032-bmo-1841571-treat-rust-libraries-as-objects.patch
new file mode 100644
index 0000000..00cadde
--- /dev/null
+++
b/http/firefox/patches/0032-bmo-1841571-treat-rust-libraries-as-objects.patch
@@ -0,0 +1,102 @@
+
+# HG changeset patch
+# User Mike Hommey <mh+mozilla AT glandium.org>
+# Date 1688455805 0
+# Node ID 8f3c18688bf43961a61f78f11f8aaef5e5de5fec
+# Parent 25c1a2b1eff10640f2c23261214875b0c13c9037
+Bug 1841571 - Treat rust libraries as objects in the build graph.
r=firefox-build-system-reviewers,sergesanspaille
+
+The build graph has dependencies like:
+ some/dir/target: some/dir/target-objects
+
+where some/dir/target-objects will build the objects in the directory,
+and some/dir/target will link some binary (executable or shared library)
+using those objects (and/or objects in other directories).
+
+From that perspective, the rust (static) libraries are more similar to
+objects, and we should treat them as such.
+
+This will allow to add the right dependencies to use a in-tree-built tool
+to link shared libraries without having building the rust libraries
+depend on it just because they are treated as other binaries in the
+build graph.
+
+Differential Revision: https://phabricator.services.mozilla.com/D182694
+
+diff --git a/config/recurse.mk b/config/recurse.mk
+--- a/config/recurse.mk
++++ b/config/recurse.mk
+@@ -230,12 +230,12 @@ ifndef TEST_MOZBUILD
+ pre-export:: $(DEPTH)/.cargo/config
+ endif
+
+ # When building gtest as part of the build (LINK_GTEST_DURING_COMPILE),
+ # force the build system to get to it first, so that it can be linked
+ # quickly without LTO, allowing the build system to go ahead with
+ # plain gkrust and libxul while libxul-gtest is being linked and
+ # dump-sym'ed.
+-ifneq (,$(filter toolkit/library/gtest/rust/target,$(compile_targets)))
+-toolkit/library/rust/target: toolkit/library/gtest/rust/target
++ifneq (,$(filter
toolkit/library/gtest/rust/target-objects,$(compile_targets)))
++toolkit/library/rust/target-objects:
toolkit/library/gtest/rust/target-objects
+ endif
+ endif
+diff --git a/config/rules.mk b/config/rules.mk
+--- a/config/rules.mk
++++ b/config/rules.mk
+@@ -381,28 +381,28 @@ else
+ resfile =
+ resfile_for_manifest =
+ endif
+
+ ##############################################
+ ifdef COMPILE_ENVIRONMENT
+ compile:: host target
+
+-host:: $(HOST_OBJS) $(HOST_PROGRAM) $(HOST_SIMPLE_PROGRAMS)
$(HOST_RUST_PROGRAMS) $(HOST_RUST_LIBRARY_FILE) $(HOST_SHARED_LIBRARY)
++host:: $(HOST_OBJS) $(HOST_PROGRAM) $(HOST_SIMPLE_PROGRAMS)
$(HOST_RUST_PROGRAMS) $(HOST_SHARED_LIBRARY)
+
+-target:: $(filter-out $(MOZBUILD_NON_DEFAULT_TARGETS),$(LIBRARY)
$(SHARED_LIBRARY) $(PROGRAM) $(SIMPLE_PROGRAMS) $(RUST_LIBRARY_FILE)
$(RUST_PROGRAMS))
++target:: $(filter-out $(MOZBUILD_NON_DEFAULT_TARGETS),$(LIBRARY)
$(SHARED_LIBRARY) $(PROGRAM) $(SIMPLE_PROGRAMS) $(RUST_PROGRAMS))
+
+ ifndef LIBRARY
+ ifdef OBJS
+ target:: $(OBJS)
+ endif
+ endif
+
+-target-objects: $(OBJS) $(PROGOBJS)
+-host-objects: $(HOST_OBJS) $(HOST_PROGOBJS)
++target-objects: $(OBJS) $(PROGOBJS) $(filter-out
$(MOZBUILD_NON_DEFAULT_TARGETS),$(RUST_LIBRARY_FILE))
++host-objects: $(HOST_OBJS) $(HOST_PROGOBJS) $(HOST_RUST_LIBRARY_FILE)
+
+ syms::
+
+ include $(MOZILLA_DIR)/config/makefiles/target_binaries.mk
+ endif
+
+ alltags:
+ $(RM) TAGS
+diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py
b/python/mozbuild/mozbuild/backend/recursivemake.py
+--- a/python/mozbuild/mozbuild/backend/recursivemake.py
++++ b/python/mozbuild/mozbuild/backend/recursivemake.py
+@@ -1379,16 +1379,18 @@ class RecursiveMakeBackend(MakeBackend):
+ self._process_non_default_target(libdef, libdef.import_name,
backend_file)
+
+ def _process_host_shared_library(self, libdef, backend_file):
+ backend_file.write("HOST_SHARED_LIBRARY = %s\n" % libdef.lib_name)
+
+ def _build_target_for_obj(self, obj):
+ if hasattr(obj, "output_category") and obj.output_category:
+ target_name = obj.output_category
++ elif isinstance(obj, BaseRustLibrary):
++ target_name = f"{obj.KIND}-objects"
+ else:
+ target_name = obj.KIND
+ if target_name == "wasm":
+ target_name = "target"
+ return "%s/%s" % (
+ mozpath.relpath(obj.objdir, self.environment.topobjdir),
+ target_name,
+ )
+
diff --git
a/http/firefox/patches/0033-bmo-1844484-override-compiler-vtables-symbol-for-pure-virtual-methods.patch
b/http/firefox/patches/0033-bmo-1844484-override-compiler-vtables-symbol-for-pure-virtual-methods.patch
new file mode 100644
index 0000000..4d5edb4
--- /dev/null
+++
b/http/firefox/patches/0033-bmo-1844484-override-compiler-vtables-symbol-for-pure-virtual-methods.patch
@@ -0,0 +1,150 @@
+
+# HG changeset patch
+# User Mike Hommey <mh+mozilla AT glandium.org>
+# Date 1690956771 0
+# Node ID b3c797d9f72325bd693c43ff9a1b110e6af964b2
+# Parent 7ee1dad073d03db2f730fd5c2baf77f37e458feb
+Bug 1844484 - Override the symbol used by compilers in vtables for pure
virtual methods. r=firefox-build-system-reviewers,ahochheiden
+
+In bug 1839743, we made the build system prefer packed relative
+relocations to elfhack when both the system libc and linker support
+them. Unfortunately, while that covers most of the benefits from
+elfhack, it doesn't cover bug 651892.
+
+To cover it, we make every C++ executable contain its own copy of
+the symbol, so that all relocations related to it become relative.
+
+And because this is actually (slightly) beneficial on macos, and because
+it's also an advantage to have our own abort called rather than the
+system's, we apply the same to all platforms.
+
+Differential Revision: https://phabricator.services.mozilla.com/D184068
+
+diff --git a/build/pure_virtual/moz.build b/build/pure_virtual/moz.build
+new file mode 100644
+--- /dev/null
++++ b/build/pure_virtual/moz.build
+@@ -0,0 +1,23 @@
++# -*- 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/.
++
++Library("pure_virtual")
++
++SOURCES += ["pure_virtual.c"]
++
++FORCE_STATIC_LIB = True
++
++USE_STATIC_LIBS = True
++
++# Build a real library so that the linker can remove it if the symbol
++# is never used.
++NO_EXPAND_LIBS = True
++
++# LTO can mess things up.
++if CONFIG["CC_TYPE"] == "clang-cl":
++ CFLAGS += ["-clang:-fno-lto"]
++else:
++ CFLAGS += ["-fno-lto"]
+diff --git a/build/pure_virtual/pure_virtual.c
b/build/pure_virtual/pure_virtual.c
+new file mode 100644
+--- /dev/null
++++ b/build/pure_virtual/pure_virtual.c
+@@ -0,0 +1,27 @@
++/* 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/. */
++
++#include <mozilla/Assertions.h>
++
++// This function is used in vtables to point at pure virtual methods.
++// The implementation in the standard library usually aborts, but
++// the function is normally never called (a call would be a bug).
++// Each of these entries in vtables, however, require an unnecessary
++// dynamic relocation. Defining our own function makes the linker
++// point the vtables here instead of the standard library, replacing
++// the dynamic relocations with relative relocations.
++//
++// On Windows, it doesn't really make a difference, but on macOS it
++// can be packed better, saving about 10KB in libxul, and on 64-bits
++// ELF systems, with packed relative relocations, it saves 140KB.
++//
++// Another advantage of having our own is that we can use MOZ_CRASH
++// instead of the system's abort.
++#ifdef _MSC_VER
++int __cdecl _purecall() { MOZ_CRASH("pure virtual call"); }
++#else
++__attribute__((visibility("hidden"))) void __cxa_pure_virtual() {
++ MOZ_CRASH("pure virtual call");
++}
++#endif
+diff --git a/mfbt/moz.build b/mfbt/moz.build
+--- a/mfbt/moz.build
++++ b/mfbt/moz.build
+@@ -200,8 +200,13 @@ SOURCES += [
+ SOURCES["lz4/xxhash.c"].flags += ["-Wno-unused-function"]
+
+ DisableStlWrapping()
+
+ if CONFIG["MOZ_NEEDS_LIBATOMIC"]:
+ OS_LIBS += ["atomic"]
+
+ DEFINES["LZ4LIB_VISIBILITY"] = ""
++
++# This is kind of gross because this is not a subdirectory,
++# but pure_virtual requires mfbt to build and some projects
++# don't use mfbt.
++DIRS += ["../build/pure_virtual"]
+diff --git a/python/mozbuild/mozbuild/frontend/emitter.py
b/python/mozbuild/mozbuild/frontend/emitter.py
+--- a/python/mozbuild/mozbuild/frontend/emitter.py
++++ b/python/mozbuild/mozbuild/frontend/emitter.py
+@@ -383,16 +383,18 @@ class TreeMetadataEmitter(LoggingMixin):
+ if (
+ context.config.substs.get("MOZ_STDCXX_COMPAT")
+ and context.config.substs.get(self.ARCH_VAR.get(obj.KIND))
== "Linux"
+ ):
+ self._link_library(
+ context, obj, variable, self.STDCXXCOMPAT_NAME[obj.KIND]
+ )
+ if obj.KIND == "target":
++ if "pure_virtual" in self._libs:
++ self._link_library(context, obj, variable,
"pure_virtual")
+ for lib in context.config.substs.get("STLPORT_LIBS", []):
+ obj.link_system_library(lib)
+
+ def _link_library(self, context, obj, variable, path):
+ force_static = path.startswith("static:") and obj.KIND == "target"
+ if force_static:
+ path = path[7:]
+ name = mozpath.basename(path)
+diff --git a/toolkit/crashreporter/test/unit/test_crash_purevirtual.js
b/toolkit/crashreporter/test/unit/test_crash_purevirtual.js
+--- a/toolkit/crashreporter/test/unit/test_crash_purevirtual.js
++++ b/toolkit/crashreporter/test/unit/test_crash_purevirtual.js
+@@ -1,24 +1,16 @@
+ add_task(async function run_test() {
+ if (!("@mozilla.org/toolkit/crash-reporter;1" in Cc)) {
+ dump(
+ "INFO | test_crash_purevirtual.js | Can't test crashreporter in a
non-libxul build.\n"
+ );
+ return;
+ }
+
+- var isOSX = "nsILocalFileMac" in Ci;
+- if (isOSX) {
+- dump(
+- "INFO | test_crash_purevirtual.js | TODO: purecalls not caught on OS
X\n"
+- );
+- return;
+- }
+-
+ // Try crashing with a pure virtual call
+ await do_crash(
+ function () {
+ crashType = CrashTestUtils.CRASH_PURE_VIRTUAL_CALL;
+ crashReporter.annotateCrashReport("TestKey", "TestValue");
+ },
+ function (mdump, extra) {
+ Assert.equal(extra.TestKey, "TestValue");
+
diff --git a/http/firefox/patches/0034-bgo-911679-gcc-binutils-2.41.patch
b/http/firefox/patches/0034-bgo-911679-gcc-binutils-2.41.patch
new file mode 100644
index 0000000..9f8ce30
--- /dev/null
+++ b/http/firefox/patches/0034-bgo-911679-gcc-binutils-2.41.patch
@@ -0,0 +1,60 @@
+--- a/media/ffvpx/libavcodec/x86/mathops.h
++++ b/media/ffvpx/libavcodec/x86/mathops.h
+@@ -35,12 +35,20 @@
+ static av_always_inline av_const int MULL(int a, int b, unsigned shift)
+ {
+ int rt, dummy;
++ if (__builtin_constant_p(shift))
+ __asm__ (
+ "imull %3 \n\t"
+ "shrdl %4, %%edx, %%eax \n\t"
+ :"=a"(rt), "=d"(dummy)
+- :"a"(a), "rm"(b), "ci"((uint8_t)shift)
++ :"a"(a), "rm"(b), "i"(shift & 0x1F)
+ );
++ else
++ __asm__ (
++ "imull %3 \n\t"
++ "shrdl %4, %%edx, %%eax \n\t"
++ :"=a"(rt), "=d"(dummy)
++ :"a"(a), "rm"(b), "c"((uint8_t)shift)
++ );
+ return rt;
+ }
+
+@@ -113,19 +121,31 @@ __asm__ volatile(\
+ // avoid +32 for shift optimization (gcc should do that ...)
+ #define NEG_SSR32 NEG_SSR32
+ static inline int32_t NEG_SSR32( int32_t a, int8_t s){
++ if (__builtin_constant_p(s))
+ __asm__ ("sarl %1, %0\n\t"
+ : "+r" (a)
+- : "ic" ((uint8_t)(-s))
++ : "i" (-s & 0x1F)
+ );
++ else
++ __asm__ ("sarl %1, %0\n\t"
++ : "+r" (a)
++ : "c" ((uint8_t)(-s))
++ );
+ return a;
+ }
+
+ #define NEG_USR32 NEG_USR32
+ static inline uint32_t NEG_USR32(uint32_t a, int8_t s){
++ if (__builtin_constant_p(s))
+ __asm__ ("shrl %1, %0\n\t"
+ : "+r" (a)
+- : "ic" ((uint8_t)(-s))
++ : "i" (-s & 0x1F)
+ );
++ else
++ __asm__ ("shrl %1, %0\n\t"
++ : "+r" (a)
++ : "c" ((uint8_t)(-s))
++ );
+ return a;
+ }
+
+--
+2.30.2
- [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (dd3f83a2cbe295439f4ee1d484873e1d4680a1bb), Pavel Vinogradov, 08/07/2023
Archive powered by MHonArc 2.6.24.