[Webkit-unassigned] [Bug 232938] Reduce memory usage when not using the Gold linker

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 16 13:50:48 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=232938

Adrian Perez <aperez at igalia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aperez at igalia.com
 Attachment #443794|review?                     |review-
              Flags|                            |

--- Comment #4 from Adrian Perez <aperez at igalia.com> ---
Comment on attachment 443794
  --> https://bugs.webkit.org/attachment.cgi?id=443794
Patch

In general I do not like this patch because it's going to make the build
process slower for everybody, even for people with plenty of memory to
spare which do not really need to use this linker option. From the ld man
page:

  “This option reduces memory requirements at ld runtime, at the expense
   of linking speed.”

Making linking slower is something that we definitely *not* want in general,
because who spends more time building (and linking) WebKit are developers.
We would rather optimize by default to have shorter edit-compile-test cycles.
Coincidentally, that's the reason why developer builds use LLD if available:
it gets the job done faster.

If you have some *particular* setup in which this is needed, you can specify
the option as part of the LDFLAGS environment variable, and CMake will apply
it for you:

   % LDFLAGS="-Wl,--reduce-memory-overheads" cmake ...

or, if you are using the “build-webkit” script for development:

   % LDFLAGS="-Wl,--reduce-memory-overheads" Tools/Scripts/build-webkit ...

If there is some reason why this is not an option for you, please do explain
and we can reconsider adding something to the WebKit build system, and make it
opt-in — but I would prefer to avoid hardcoding options in our build system
for one-off configurations which typically can be done as suggested above :)


View in context: https://bugs.webkit.org/attachment.cgi?id=443794&action=review

> Source/cmake/OptionsCommon.cmake:107
> +    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--reduce-memory-overheads")

This has changed quite a bit, so currently you should check the LD_VARIANT
variable to only add these options when using the BFD linker. Like this:

  if (LD_VARIANT STREQUAL BFD)
      # Do things.
  endif ()

This is missing adding the option to CMAKE_MODULE_LINKER_FLAGS, too.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220216/14b75fa1/attachment-0001.htm>


More information about the webkit-unassigned mailing list