Reduce memory usage while linking on arm{el,hf} platforms
authorCarsten Schoenert <c.schoenert@t-online.de>
Sun, 6 Oct 2019 06:28:58 +0000 (08:28 +0200)
committerCarsten Schoenert <c.schoenert@t-online.de>
Mon, 19 Apr 2021 18:00:32 +0000 (19:00 +0100)
The build even on armhf is failing while linking mostly due exhausted
memory usage. Reduce the memory usage on arm{el,hf} platform by telling
the linker to not hold used memory.

Author: Olivier Tilloy <olivier.tilloy@canonical.com>

Gbp-Pq: Topic porting-arm
Gbp-Pq: Name Reduce-memory-usage-while-linking-on-arm-el-hf-platforms.patch

build/moz.configure/toolchain.configure

index 5ef6e31089b4f39f0e66448d74f0f1daad0d023d..d6cadded74f1d8130e18ade4a1d1d92dac1f0bd0 100755 (executable)
@@ -2127,15 +2127,16 @@ def select_linker(linker, c_compiler, developer_options, enable_gold,
 set_config('LINKER_KIND', select_linker.KIND)
 
 
-@depends_if(select_linker, macos_sdk)
-def linker_ldflags(linker, macos_sdk):
+@depends_if(select_linker, macos_sdk, host)
+def linker_ldflags(linker, macos_sdk, host):
     flags = list(linker.LINKER_FLAG or [])
     if macos_sdk:
         if linker.KIND == 'ld64':
             flags.append('-Wl,-syslibroot,%s' % macos_sdk)
         else:
             flags.append('-Wl,--sysroot=%s' % macos_sdk)
-
+    elif host.cpu == 'arm':
+        flags.append('-Wl,--no-keep-memory')
     return flags