2020-07-30 17:51:35 +02:00
|
|
|
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
|
2021-06-02 20:41:13 +02:00
|
|
|
@@ -2349,15 +2349,17 @@
|
2020-12-20 20:49:13 +01:00
|
|
|
set_config("LINKER_KIND", select_linker.KIND)
|
2020-07-30 17:51:35 +02:00
|
|
|
|
|
|
|
|
2021-06-02 20:41:13 +02:00
|
|
|
-@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):
|
2020-08-27 10:03:03 +02:00
|
|
|
flags = list((linker and linker.LINKER_FLAG) or [])
|
2021-06-02 20:41:13 +02:00
|
|
|
if target.kernel == "Darwin":
|
2020-12-20 20:49:13 +01:00
|
|
|
if linker and linker.KIND == "ld64":
|
2021-06-02 20:41:13 +02:00
|
|
|
flags.append("-Wl,-syslibroot,%s" % macos_sdk)
|
2020-07-30 17:51:35 +02:00
|
|
|
else:
|
2020-12-20 20:49:13 +01:00
|
|
|
flags.append("-Wl,--sysroot=%s" % macos_sdk)
|
2021-03-24 10:59:27 +01:00
|
|
|
+ if host.cpu == "arm":
|
|
|
|
+ flags.append("-Wl,--no-keep-memory")
|
2021-06-02 20:41:13 +02:00
|
|
|
|
2021-03-24 10:59:27 +01:00
|
|
|
if sysroot_path and multiarch_dir:
|
2021-06-02 20:41:13 +02:00
|
|
|
for d in ("lib", "usr/lib"):
|