summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--newmoon/UXP-Enable-LTO-to-work.patch86
-rw-r--r--newmoon/debian/mozconfig12
-rw-r--r--newmoon/newmoon-mozconfig16
-rw-r--r--newmoon/newmoon.spec10
4 files changed, 108 insertions, 16 deletions
diff --git a/newmoon/UXP-Enable-LTO-to-work.patch b/newmoon/UXP-Enable-LTO-to-work.patch
new file mode 100644
index 0000000..15f806c
--- /dev/null
+++ b/newmoon/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/mozconfig b/newmoon/debian/mozconfig
index 0d9b773..81c659a 100644
--- a/newmoon/debian/mozconfig
+++ b/newmoon/debian/mozconfig
@@ -26,7 +26,6 @@ ac_add_options --enable-devtools
ac_add_options --enable-jemalloc
ac_add_options --with-pthreads
ac_add_options --enable-strip
-#ac_add_options --enable-phoenix-extensions
# Disables
ac_add_options --disable-debug
ac_add_options --disable-eme
@@ -34,8 +33,6 @@ ac_add_options --disable-gamepad
ac_add_options --disable-necko-wifi
ac_add_options --disable-tests
ac_add_options --disable-updater
-# unfortunately newmoon does not have the client-side bits for webrtc so enabling it does nothing, per upstream
-#ac_add_options --enable-webrtc
# Disable temeletry
export MOZ_TELEMETRY_REPORTING=
ac_add_options --disable-crashreporter
@@ -55,15 +52,6 @@ ac_add_options --disable-gnomeui
ac_add_options --disable-gconf
ac_add_options --disable-sync
ac_add_options --disable-personas
-#ac_add_options --with-system-ffi
-#ac_add_options --with-system-cairo
-#ac_add_options --with-system-pixman
-#ac_add_options --with-system-bz2
-#ac_add_options --with-system-zlib
-#ac_add_options --with-system-jpeg
-# my own research into the codebase
-#ac_add_options --with-system-hunspell
-#ac_add_options --with-system-extension-dirs
# primarily for 32-bit but tolerated for 64-bit
ac_add_options --x-libraries=/usr/lib
diff --git a/newmoon/newmoon-mozconfig b/newmoon/newmoon-mozconfig
index 39c9feb..04fd1cc 100644
--- a/newmoon/newmoon-mozconfig
+++ b/newmoon/newmoon-mozconfig
@@ -23,10 +23,8 @@ MOZ_REQUIRE_SIGNING=
ac_add_options --enable-default-toolkit=cairo-gtk2
ac_add_options --enable-jemalloc
ac_add_options --enable-av1
-#ac_add_options --enable-shared-js
ac_add_options --enable-strip
ac_add_options --with-pthreads
-#ac_add_options --enable-phoenix-extensions
ac_add_options --disable-tests
ac_add_options --disable-debug
@@ -43,3 +41,17 @@ ac_add_options --disable-updater
export MOZ_TELEMETRY_REPORTING=
ac_add_options --x-libraries=/usr/lib
+
+# experimental for rpm but from deb
+ac_add_options --enable-devtools
+ac_add_options --enable-alsa
+ac_add_options --disable-sync
+ac_add_options --disable-personas
+export MOZ_PKG_SPECIAL=gtk2
+
+# experimental for linker and LTO stuff
+export CFLAGS="${CFLAGS} -flto=$(nproc)"
+export CXXFLAGS="${CXXFLAGS} -flto=$(nproc)"
+export LDFLAGS="${LDFLAGS} -Wl,-z,norelro"
+ac_add_options --disable-elf-hack
+ac_add_options --disable-gold
diff --git a/newmoon/newmoon.spec b/newmoon/newmoon.spec
index 9cf74a9..f3c56da 100644
--- a/newmoon/newmoon.spec
+++ b/newmoon/newmoon.spec
@@ -45,7 +45,7 @@ Name: newmoon
%endif
Summary: Newmoon web browser
Version: 29.4.2
-Release: 1
+Release: 2
Group: Networking/Web
License: MPLv2.0
@@ -62,6 +62,7 @@ Source6: bluemoon-icons.tgz
Patch0: small-icons.patch
Patch1: pm-fedora.patch
Patch2: pm-to-nm.patch
+Patch3: UXP-Enable-LTO-to-work.patch
%endif
Packager: B. Stack <bgstack15@gmail.com>
@@ -123,6 +124,7 @@ sed -i -r -e '/enable-optimize/s/"\s*$/ -Wno-format-overflow"/' ./.mozconfig
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
! test -d %{badname}/branding/unofficial.unbuilt && {
cp -pr %{badname}/branding/unofficial %{badname}/branding/unofficial.unbuilt && \
@@ -300,7 +302,11 @@ update-mime-database -n ${_datadir}/mime 1>/dev/null 2>&1 & :
%doc AUTHORS LICENSE
%changelog
-* Tue Nov 11 2021 B. Stack <bgstack15@gmail.com> - 29.4.2-1
+* Wed Nov 10 2021 B. Stack <bgstack15@gmail.com> - 29.4.2-2
+- Experiment with some mozconfig entries that work for dpkg
+- Experiment with LTO patch and disable-gold
+
+* Tue Nov 09 2021 B. Stack <bgstack15@gmail.com> - 29.4.2-1
- update version
* Wed Sep 15 2021 B. Stack <bgstack15@gmail.com> - 29.4.1-1
bgstack15