summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--newmoon/debian/changelog7
-rw-r--r--newmoon/debian/mozconfig8
-rw-r--r--newmoon/debian/patches/UXP-Enable-LTO-to-work.patch86
-rw-r--r--newmoon/debian/patches/series1
4 files changed, 101 insertions, 1 deletions
diff --git a/newmoon/debian/changelog b/newmoon/debian/changelog
index 725d65a..b70e5cb 100644
--- a/newmoon/debian/changelog
+++ b/newmoon/debian/changelog
@@ -1,3 +1,10 @@
+newmoon (29.4.2-2+devuan) obs; urgency=medium
+
+ - Use LTO patch from Gord
+ - Try make -j$(nproc) again
+
+ -- B. Stack <bgstack15@gmail.com> Tue, 11 Nov 2021 16:10:39 -0500
+
newmoon (29.4.2-1+devuan) obs; urgency=medium
- This is a security update.
diff --git a/newmoon/debian/mozconfig b/newmoon/debian/mozconfig
index 47cd6ec..967a2bc 100644
--- a/newmoon/debian/mozconfig
+++ b/newmoon/debian/mozconfig
@@ -70,6 +70,12 @@ ac_add_options --x-libraries=/usr/lib
# limit to 4 cpus to limit memory usage (approximately 0.75 GiB RAM/thread)
# Debian Sid/Devuan Ceres; 2020-07 only -j1 works due to a bug.
-mk_add_options MOZ_MAKE_FLAGS="-j1"
+# 2021-11 try -j$(nproc) again
+mk_add_options MOZ_MAKE_FLAGS="-j$(nproc)"
export MOZ_PKG_SPECIAL=gtk2
+# Experimental
+export CFLAGS="${CFLAGS} -flto=$(nproc)"
+export CXXFLAGS="${CXXFLAGS} -flto=$(nproc)"
+export LDFLAGS="${LDFLAGS} -Wl,-z,norelro"
+ac_add_options --disable-elf-hack
diff --git a/newmoon/debian/patches/UXP-Enable-LTO-to-work.patch b/newmoon/debian/patches/UXP-Enable-LTO-to-work.patch
new file mode 100644
index 0000000..15f806c
--- /dev/null
+++ b/newmoon/debian/patches/UXP-Enable-LTO-to-work.patch
@@ -0,0 +1,86 @@
+# This patch was created by Gordon N. Squash.
+#
+# When applied, this patch makes some minor adjustments to some assembly
+# language routines in UXP for the x86 architecture. Once these adjustments
+# are made, UXP can be compiled with LTO (link-time optimization), given a
+# proper 'mozconfig' file.
+#
+# The author discovered that you need to use the following extra lines in your
+# mozconfig file in order for LTO to work on the x86 architecture (replace all
+# instances of `[n]` with the number of parallel LTO jobs you want -- it's
+# generally safe to use the same number here that you use in
+# `MAKEOPTS="-j[n]"`):
+#
+# ```
+# export CFLAGS="${CFLAGS} -flto=[n]"
+# export CXXFLAGS="${CXXFLAGS} -flto=[n]"
+# export LDFLAGS="${LDFLAGS} -Wl,-z,norelro"
+# ac_add_options --disable-elf-hack
+# ac_add_options --disable-gold
+# ```
+# You may also want to add "${CFLAGS}" to the `--enable-optimize` option, if
+# you want to ensure everything gets LTO-optimized.
+#
+#===============================================================================
+#
+# This patch *appears to be* stable. It does not seem to adversely affect
+# UXP, though the author stresses that this patch needs to be tested more widely
+# before any conclusions can be drawn about its stability.
+#
+# WARNING! This is not an official patch in any way, shape or form! Do not
+# contact the original authors of UXP for support of this patch!
+#
+diff -uprN palemoon-29.4.1-original/platform/gfx/ycbcr/yuv_row_posix.cpp palemoon-29.4.1-patched/platform/gfx/ycbcr/yuv_row_posix.cpp
+--- palemoon-29.4.1-original/platform/gfx/ycbcr/yuv_row_posix.cpp 2021-09-12 04:41:57.000000000 -0400
++++ palemoon-29.4.1-patched/platform/gfx/ycbcr/yuv_row_posix.cpp 2021-11-08 16:02:31.236354000 -0500
+@@ -572,6 +572,8 @@ void PICConvertYUVToRGB32Row_SSE(const u
+
+ asm(
+ ".text\n"
++ ".globl PICConvertYUVToRGB32Row_SSE\n"
++ ".type PICConvertYUVToRGB32Row_SSE,@function\n"
+ "PICConvertYUVToRGB32Row_SSE:\n"
+ "pusha\n"
+ "mov 0x24(%esp),%edx\n"
+@@ -649,6 +651,8 @@ void PICScaleYUVToRGB32Row_SSE(const uin
+
+ asm(
+ ".text\n"
++ ".globl PICScaleYUVToRGB32Row_SSE\n"
++ ".type PICScaleYUVToRGB32Row_SSE,@function\n"
+ "PICScaleYUVToRGB32Row_SSE:\n"
+ "pusha\n"
+ "mov 0x24(%esp),%edx\n"
+@@ -741,6 +745,8 @@ void PICLinearScaleYUVToRGB32Row_SSE(con
+
+ asm(
+ ".text\n"
++ ".globl PICLinearScaleYUVToRGB32Row_SSE\n"
++ ".type PICLinearScaleYUVToRGB32Row_SSE,@function\n"
+ "PICLinearScaleYUVToRGB32Row_SSE:\n"
+ "pusha\n"
+ "mov 0x24(%esp),%edx\n"
+diff -uprN palemoon-29.4.1-original/platform/xpcom/reflect/xptcall/md/unix/xptcinvoke_gcc_x86_unix.cpp palemoon-29.4.1-patched/platform/xpcom/reflect/xptcall/md/unix/xptcinvoke_gcc_x86_unix.cpp
+--- palemoon-29.4.1-original/platform/xpcom/reflect/xptcall/md/unix/xptcinvoke_gcc_x86_unix.cpp 2021-09-12 04:42:29.000000000 -0400
++++ palemoon-29.4.1-patched/platform/xpcom/reflect/xptcall/md/unix/xptcinvoke_gcc_x86_unix.cpp 2021-11-08 15:50:33.268324000 -0500
+@@ -9,7 +9,7 @@
+ #include "xptc_gcc_x86_unix.h"
+
+ extern "C" {
+-static void ATTRIBUTE_USED __attribute__ ((regparm(3)))
++void ATTRIBUTE_USED __attribute__ ((regparm(3)))
+ invoke_copy_to_stack(uint32_t paramCount, nsXPTCVariant* s, uint32_t* d)
+ {
+ for(uint32_t i = paramCount; i >0; i--, d++, s++)
+diff -uprN palemoon-29.4.1-original/platform/xpcom/reflect/xptcall/md/unix/xptcstubs_gcc_x86_unix.cpp palemoon-29.4.1-patched/platform/xpcom/reflect/xptcall/md/unix/xptcstubs_gcc_x86_unix.cpp
+--- palemoon-29.4.1-original/platform/xpcom/reflect/xptcall/md/unix/xptcstubs_gcc_x86_unix.cpp 2021-09-12 04:42:29.000000000 -0400
++++ palemoon-29.4.1-patched/platform/xpcom/reflect/xptcall/md/unix/xptcstubs_gcc_x86_unix.cpp 2021-11-08 15:51:36.440327000 -0500
+@@ -10,7 +10,7 @@
+ #include "xptc_gcc_x86_unix.h"
+
+ extern "C" {
+-static nsresult ATTRIBUTE_USED
++nsresult ATTRIBUTE_USED
+ __attribute__ ((regparm (3)))
+ PrepareAndDispatch(uint32_t methodIndex, nsXPTCStubBase* self, uint32_t* args)
+ {
diff --git a/newmoon/debian/patches/series b/newmoon/debian/patches/series
index baa043e..296e77f 100644
--- a/newmoon/debian/patches/series
+++ b/newmoon/debian/patches/series
@@ -1,3 +1,4 @@
small-icons.patch
pm-devuan.patch
pm-to-nm.patch
+UXP-Enable-LTO-to-work.patch
bgstack15