Browse Source

port bugs 1079662 abd 1787182

Bill Gianopoulos 1 year ago
parent
commit
2484f29f60

+ 145 - 0
comm-central/patches/9999999-port1079662-suite.patch

@@ -0,0 +1,145 @@
+# HG changeset patch
+# User Bill Gianopoulos <wgianopoulos@gmail.com>
+# Date 1687168509 0
+Bug - Port bug 1079662 to suite.
+Bug 1079662 - Always enable PIE.
+
+diff --git a/suite/app/Makefile.in b/suite/app/Makefile.in
+--- a/suite/app/Makefile.in
++++ b/suite/app/Makefile.in
+@@ -49,20 +49,21 @@ ifeq ($(OS_ARCH),WINNT)
+ 
+ else
+ 	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/
+ endif
+ 
+ ifneq ($(OS_ARCH),WINNT)
+ 
+ ifdef COMPILE_ENVIRONMENT
++ifndef MOZ_NO_PIE_COMPAT
+ libs::
+ 	cp -p $(DIST)/bin/$(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
+ endif
+-
++endif
+ endif
+ 
+ ifneq (,$(filter-out WINNT Darwin,$(OS_ARCH)))
+ $(MOZ_APP_NAME).1: $(srcdir)/seamonkey.man.in $(GLOBAL_DEPS) $(DEPTH)/config/autoconf.mk
+ 	@sed -e "s|\@bindir\@|$(bindir)|g" -e "s|\@mozappdir\@|$(mozappdir)|g" \
+ 		-e "s|\@MOZ_APP_DISPLAYNAME\@|$(MOZ_APP_DISPLAYNAME)|g" \
+ 		-e "s|\@MOZ_APP_NAME\@|$(MOZ_APP_NAME)|g" \
+ 		-e "s|\@MOZ_APP_VERSION\@|${MOZ_APP_VERSION}|g" < $< > $@
+diff --git a/suite/app/moz.build b/suite/app/moz.build
+--- a/suite/app/moz.build
++++ b/suite/app/moz.build
+@@ -2,17 +2,22 @@
+ # 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/.
+ 
+ DIRS += [
+     "icons",
+ ]
+ 
+-GeckoProgram(CONFIG["MOZ_APP_NAME"])
++if CONFIG['MOZ_NO_PIE_COMPAT']:
++    GeckoProgram(CONFIG['MOZ_APP_NAME'] + '-bin')
++
++    DIRS += ['no-pie']
++else:
++    GeckoProgram(CONFIG['MOZ_APP_NAME'])
+ 
+ SOURCES += ["nsSuiteApp.cpp"]
+ 
+ LOCAL_INCLUDES += [
+     "!/build",
+     "/ipc/contentproc/",
+     "/toolkit/xre",
+     "/xpcom/base",
+diff --git a/suite/app/no-pie/NoPie.c b/suite/app/no-pie/NoPie.c
+new file mode 100644
+--- /dev/null
++++ b/suite/app/no-pie/NoPie.c
+@@ -0,0 +1,27 @@
++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
++/* 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 <errno.h>
++#include <limits.h>
++#include <stdio.h>
++#include <string.h>
++#include <unistd.h>
++
++int main(int argc, char* argv[])
++{
++  // Ideally, we'd use mozilla::BinaryPath, but that pulls in stdc++compat,
++  // and further causes trouble linking with LTO.
++  char path[PATH_MAX + 4];
++  ssize_t len = readlink("/proc/self/exe", path, PATH_MAX - 1);
++  if (len < 0) {
++    fprintf(stderr, "Couldn't find the application directory.\n");
++    return 255;
++  }
++  strcpy(path + len, "-bin");
++  execv(path, argv);
++  // execv never returns. If it did, there was an error.
++  fprintf(stderr, "Exec failed with error: %s\n", strerror(errno));
++  return 255;
++}
+diff --git a/suite/app/no-pie/moz.build b/suite/app/no-pie/moz.build
+new file mode 100644
+--- /dev/null
++++ b/suite/app/no-pie/moz.build
+@@ -0,0 +1,22 @@
++# -*- 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/.
++
++Program(CONFIG['MOZ_APP_NAME'])
++
++SOURCES += [
++    'NoPie.c',
++]
++
++# For some reason, LTO messes things up. We don't care anyways.
++CFLAGS += [
++    '-fno-lto',
++]
++
++# Use OS_LIBS instead of LDFLAGS to "force" the flag to come after -pie
++# from MOZ_PROGRAM_LDFLAGS.
++OS_LIBS += [
++    '-no-pie'
++]
+diff --git a/suite/moz.configure b/suite/moz.configure
+--- a/suite/moz.configure
++++ b/suite/moz.configure
+@@ -101,16 +101,23 @@ option(
+ 
+ @depends_if("--enable-debugqa")
+ def debugqa(arg):
+     return True
+ 
+ 
+ set_config("MOZ_DEBUGQA", debugqa)
+ 
++with only_when(target_has_linux_kernel & compile_environment):
++    option(env='MOZ_NO_PIE_COMPAT',
++           help='Enable non-PIE wrapper')
++
++    set_config('MOZ_NO_PIE_COMPAT',
++               depends_if('MOZ_NO_PIE_COMPAT')(lambda _: True))
++
+ # Miscellaneous programs
+ # ==============================================================
+ 
+ check_prog("ZIP", ("zip",))
+ 
+ include("../build/moz.configure/gecko_source.configure")
+ 
+ include("../mailnews/moz.configure")

+ 30 - 0
comm-central/patches/9999999-port1787182-suite-bustage.patch

@@ -0,0 +1,30 @@
+# HG changeset patch
+# User Bill Gianopoulos <wgianopoulos@gmail.com>
+# Date 1687176801 0
+Bug 9999999 - Port bug 1787182 to suite.
+Bug 1787182 - Don't fire glxtest process for remote instances (VAAPI test sometimes hangs Firefox on AMD.
+
+diff --git a/suite/installer/package-manifest.in b/suite/installer/package-manifest.in
+--- a/suite/installer/package-manifest.in
++++ b/suite/installer/package-manifest.in
+@@ -130,18 +130,20 @@
+ @BINPATH@/@DLL_PREFIX@mozsqlite3@DLL_SUFFIX@
+ #endif
+ @BINPATH@/@DLL_PREFIX@lgpllibs@DLL_SUFFIX@
+ #ifdef MOZ_FFVPX
+ @BINPATH@/@DLL_PREFIX@mozavutil@DLL_SUFFIX@
+ @BINPATH@/@DLL_PREFIX@mozavcodec@DLL_SUFFIX@
+ #endif
+ #ifdef MOZ_GTK
++@BINPATH@/glxtest
+ @BINPATH@/@DLL_PREFIX@mozgtk@DLL_SUFFIX@
+ #ifdef MOZ_WAYLAND
++@BINPATH@/vaapitest
+ @BINPATH@/@DLL_PREFIX@mozwayland@DLL_SUFFIX@
+ #endif
+ #endif
+ @RESPATH@/license.txt
+ @RESPATH@/blocklist.xml
+ #ifdef XP_WIN
+ #ifdef _AMD64_
+ @BINPATH@/@DLL_PREFIX@qipcap64@DLL_SUFFIX@

+ 2 - 0
comm-central/patches/series

@@ -1,4 +1,6 @@
+9999999-port1787182-suite-bustage.patch
 9999999-port1821963-suite-bustage.patch
 9999999-port1821963-suite-bustage.patch
+9999999-port1079662-suite.patch
 TOP-1642188-remove-nsDOMIEvent-cc.patch
 TOP-1642188-remove-nsDOMIEvent-cc.patch
 TOP-1611010-DOMEventListener-cc.patch
 TOP-1611010-DOMEventListener-cc.patch
 TOP-1614671-port1456035-4-and-5-61a1-cc.patch
 TOP-1614671-port1456035-4-and-5-61a1-cc.patch