[Mesa-dev] [PATCH] Use -Bsymbolic when linking libEGL.so

Eric Anholt eric at anholt.net
Sat Sep 28 00:38:15 PDT 2013


Carl Worth <cworth at cworth.org> writes:

> For some reason that I don't yet fully understand, Glaze does not work with
> libEGL unless libEGL is linked with -Bsymbolic.[*]
>
> Beyond that specific reason, all of the reasons for which libGL.so is linked
> with -Bsymbolic, (see the commit history), should also apply here.
>
> [*] The specific behavior I am seeing is that when Glaze calls dlopen for
> libEGL.so, ifunc resolvers within Glaze for EGL functions are called before
> the dlopen returns. These resolvers cannot succeed, as they need the return
> value from dlopen in order to find the functions to resolve to. I don't know
> what's causing these resolvers to be called, but I have verified that linking
> libEGL with -Bsymbolic causes this problematic behavior to stop.

Could you print which thing is trying to get resolved early?  I see a
few egl* calls within main/egl*.c (eglQueryAPI(), eglGetDisplay(),
eglWaitClient()), and I'm wondering if not having Bsymbolic on them is
causing an RTLD_NOW (perhaps by the glaze-find-libgl.c?) to try to call
the ifuncs early.

We should certainly be using Bsymbolic, and I'd like to see this go to
stable.

Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130928/f3de25a9/attachment.pgp>


More information about the mesa-dev mailing list