summaryrefslogtreecommitdiff
path: root/armhf-reduce-linker-memory-use.patch
blob: dbe74cfe17150de3762b817618bf30cd95788465 (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
Description: starting with firefox 66, armhf builds on Launchpad frequently
 fail with "/usr/bin/ld: final link failed: memory exhausted" when linking
 libxul.so. This is an attempt to reduce the memory used by ld.
Author: Olivier Tilloy <olivier.tilloy@canonical.com>

--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -2349,15 +2349,17 @@
 set_config("LINKER_KIND", select_linker.KIND)
 
 
-@depends_if(select_linker, target, macos_sdk, sysroot_path, multiarch_dir)
+@depends_if(select_linker, target, macos_sdk, sysroot_path, multiarch_dir, host)
 @imports("os")
-def linker_ldflags(linker, target, macos_sdk, sysroot_path, multiarch_dir):
+def linker_ldflags(linker, target, macos_sdk, sysroot_path, multiarch_dir, host):
     flags = list((linker and linker.LINKER_FLAG) or [])
     if target.kernel == "Darwin":
         if linker and linker.KIND == "ld64":
             flags.append("-Wl,-syslibroot,%s" % macos_sdk)
         else:
             flags.append("-Wl,--sysroot=%s" % macos_sdk)
+    if host.cpu == "arm":
+        flags.append("-Wl,--no-keep-memory")
 
     if sysroot_path and multiarch_dir:
         for d in ("lib", "usr/lib"):
bgstack15