Reduce memory usage when not using the Gold linker
authorAlberto Garcia <berto@igalia.com>
Mon, 13 Jul 2020 23:38:23 +0000 (00:38 +0100)
committerAlberto Garcia <berto@igalia.com>
Mon, 13 Jul 2020 23:38:23 +0000 (00:38 +0100)
Bug-Debian: https://bugs.debian.org/949621
Forwarded: no

===================================================================

Gbp-Pq: Name reduce-memory-overheads.patch

Source/cmake/OptionsCommon.cmake

index a574ef8c222ba0720d22a1fd5d5c8153a4dcf721..1eacda8aadf8914b7afaee523e2432be5fdf3978 100644 (file)
@@ -112,6 +112,12 @@ if (DEBUG_FISSION)
     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gdb-index")
 endif ()
 
+# Pass --reduce-memory-overheads to the bfd linker in order to save memory
+if (NOT USE_LD_GOLD)
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--reduce-memory-overheads")
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--reduce-memory-overheads")
+endif ()
+
 # Enable the usage of OpenMP.
 #  - At this moment, OpenMP is only used as an alternative implementation
 #    to native threads for the parallelization of the SVG filters.