[Mesa-dev] [PATCH] src: replace RTLD_NOW with RTLD_LAZY

Emil Velikov emil.l.velikov at gmail.com
Sat Aug 6 17:37:14 UTC 2016


On 6 August 2016 at 01:42, Jan Ziak <0xe2.0x9a.0x9b at gmail.com> wrote:
> Mesa source code prior to this patch uses both RTLD_NOW and RTLD_LAZY.
> This patch removes all RTLD_NOW in favor of RTLD_LAZY.
>
> In comparison to early binding, lazy binding reduces CPU instruction count
> of small GL apps (e.g: glxinfo) by 6 million instructions.
> Larger apps won't notice the difference.
>
> Signed-off-by: Jan Ziak (http://atom-symbol.net) <0xe2.0x9a.0x9b at gmail.com>
> ---
>  src/egl/drivers/dri2/egl_dri2.c |  6 +++---
>  src/gbm/backends/dri/gbm_dri.c  |  6 +++---
>  src/glx/apple/apple_cgl.c       |  2 +-
>  src/glx/dri_common.c            | 10 +++++-----
>  4 files changed, 12 insertions(+), 12 deletions(-)
>
There's a ton of question/topics getting cross referenced that this
patch started, so rather than writing 20 replies there's a one that
should cover things.

 - LAZY vs NOW - I'm ok with the former if we get an extra test (see below)
 - the dri modules are the only ones built without
-Wl,--no-undefined/-no-undefined. There's no need to extra
tools/tests.
 - we can add test(s) that check for the unresolved/undefined symbols
in the dri modules and warn/error out if needed.
 - all the classic drivers are built into a single "megadrivers"
binary. same goes on the gallium side.
 - hard vs soft links. the former is needed for compatibility/legacy
reasons. it also caught a bug in the debian packaging utilities ;-)
 - dri modules cannot/should not be linked in libGL.so. They are used
by libGL.so, libEGL.so libgbm.so and the (some versions of) xserver
libglx.so.
Thus static linking the module will a) break things or b) the overall
size will end up larger. Not to mention that due to the driver/loader
interface there will be no savings.
 - classic vs gallium swrast_dri.so, using the same binary name. this
and a few things are want made me think about mesa-maintainers at . the
idea is to have low traffic communication channel where distro
maintainers will weight in how to tackle this without breaking things
too badly :-)

Jan, please split this (and your earlier) patch - here we want egl, gbm, glx.
If you're feeling extra nice, you can fold all dri loader the
duplication from egl/gbm/glx into src/loader.

Thanks
Emil


More information about the mesa-dev mailing list