diff options
Diffstat (limited to 'newmoon/UXP-Enable-LTO-to-work.patch')
-rw-r--r-- | newmoon/UXP-Enable-LTO-to-work.patch | 86 |
1 files changed, 86 insertions, 0 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) + { |