Repository navigation
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
c4e0f6b to
8655b68
Compare
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
There are a number of issues with this, and the main one is that the environment used for building, when the test program runs, may not be the same where the built library will run. This is typical when building packages.
The other part I don't like much about this is that this is not a glibc-exclusive feature: the Musl libc has support for DT_RELR since version 1.2.4 (May 2023), and uCLibc-ng since version 1.0.46 (March 2024).
All in all, I think it would be better to make LD_SUPPORTS_PACK_RELATIVE_RELOCS detect whether the LD_USAGE variable contains pack-relative-relocs in its output, and then have an option(LD_PACK_RELATIVE_RELOCS ..) which by default takes the detected value, but can be overriden in the CMake command line. This would effectively always use the feature if the linker supports it, under the assumption that runtime support will be available. I expect that's fine because glibc 2.36 was released in August 2018. All the systems we support have glibc 2.36 or newer, and for embedded use cases that may use Musl or uCLibc we need to trust that the people doing the builds know what they are doing (and also we would provide the option that can be disabled).
Thoughts?
https://bugs.webkit.org/show_bug.cgi?id=327969 Reviewed by NOBODY (OOPS!). Most of the dynamic relocations of the WebKit libraries are relative ones, and every process reads all of them when it starts. Link with -z pack-relative-relocs, which stores them in the much smaller DT_RELR format, when the toolchain and the C library support it. On WPE, the relocations of libWPEWebKit go from 8.1 MB to 2 MB, the library is 6 MB smaller, and the total PSS of the UI, Web and Network processes is about 7.5 MB lower. * Source/cmake/OptionsCommon.cmake:
8655b68 to
e61c0ca
Compare
|
EWS run on current version of this PR (hash e61c0ca) Details |
e61c0ca
e61c0ca