summaryrefslogtreecommitdiff
path: root/newmoon/debian/patches/UXP-strip-object-files-before-shared-library-linking.patch
blob: ee6f1a053447e38053fd64fc12ec5f1cd1a66b29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# This patch was created by Gordon N. Squash.
#
# This patch, when applied, strips unneeded symbols from object files which
# are about to be linked into a library built as part of the Unified XUL
# Platform.  This is useful to reduce memory consumption during the actual
# linking process; the author of this patch has noted that stripping component
# object files before linking into a UXP library often means the linker uses
# less than a tenth of the memory that it normally would.  The author has
# also noted that with this patch applied, the linking process takes about a
# tenth as long as it normally would.
#
# As far as the author can tell, this patch does not break UXP in any way.
#
# 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-28.12.0-original/platform/config/rules.mk palemoon-28.12.0-patched/platform/config/rules.mk
--- palemoon-28.12.0-original/platform/config/rules.mk	2020-07-30 05:37:13.000000000 -0400
+++ palemoon-28.12.0-patched/platform/config/rules.mk	2020-08-19 14:02:28.300458242 -0400
@@ -776,9 +776,19 @@ ifdef DTRACE_LIB_DEPENDENT
 ifndef XP_MACOSX
 	dtrace -x nolibs -G -C -s $(MOZILLA_DTRACE_SRC) -o  $(DTRACE_PROBE_OBJ) $(shell $(EXPAND_LIBS) $(MOZILLA_PROBE_LIBS))
 endif
+ifdef ENABLE_STRIP
+ifneq ($(strip $(STATIC_LIBS)),)
+		$(EXPAND_LIBS_EXEC) -- $(STRIP) --strip-unneeded $(STATIC_LIBS)
+endif # $(STATIC_LIBS) != ""
+endif # ENABLE_STRIP
 	$(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(SUB_SHLOBJS) $(DTRACE_PROBE_OBJ) $(MOZILLA_PROBE_LIBS) $(RESFILE) $(LDFLAGS) $(WRAP_LDFLAGS) $(STATIC_LIBS) $(RUST_STATIC_LIB_FOR_SHARED_LIB) $(SHARED_LIBS) $(EXTRA_DSO_LDOPTS) $(MOZ_GLUE_LDFLAGS) $(EXTRA_LIBS) $(OS_LIBS) $(SHLIB_LDENDFILE)
 	@$(RM) $(DTRACE_PROBE_OBJ)
 else # ! DTRACE_LIB_DEPENDENT
+ifdef ENABLE_STRIP
+ifneq ($(strip $(STATIC_LIBS)),)
+		$(EXPAND_LIBS_EXEC) -- $(STRIP) --strip-unneeded $(STATIC_LIBS)
+endif # $(STATIC_LIBS) != ""
+endif # ENABLE_STRIP
 	$(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(SUB_SHLOBJS) $(RESFILE) $(LDFLAGS) $(WRAP_LDFLAGS) $(STATIC_LIBS) $(RUST_STATIC_LIB_FOR_SHARED_LIB) $(SHARED_LIBS) $(EXTRA_DSO_LDOPTS) $(MOZ_GLUE_LDFLAGS) $(EXTRA_LIBS) $(OS_LIBS) $(SHLIB_LDENDFILE)
 endif # DTRACE_LIB_DEPENDENT
 	$(call CHECK_BINARY,$@)
bgstack15