|
@@ -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")
|