[Mesa-dev] [PATCH 5/6] egl/main: expose only core EGL functions statically

Chad Versace chad.versace at intel.com
Tue May 12 12:03:20 PDT 2015

On Mon 11 May 2015, Emil Velikov wrote:
> The EGL 1.3, 1.4 and 1.5 spec explicitly mentions that providing
> static symbols for functions provided by EGL extensions is not portable.
> Considering that relatively recently we've seen a non-mesa desktop EGL
> implementation, the fact that we opt for such behaviour has gone
> unnoticed.

This patch is sufficiently contentious that it warrants a specification
quote. Please drop it into the commit message.

    From the EGL 1.5 specification:
        For functions that are queryable with eglGetProcAddress,
        implementations may choose to also export those functions
        statically from the object libraries implementing those
        functions. However, portable clients cannot rely on this

> To encourage devs against writing such non-portable code, let's hide the
> symbols similar to the official binary driver from NVIDIA.

I think this patch is a good idea, and I consider it Mesa's mistake that
it has statically exposed these extension functions for so long. But,
I'm also afraid of that this patch may break existing apps that were
linked against Mesa in a non-portable way.

I've convinced myself that this patch is the right thing to do, even if
it does break some non-portable apps.

    1. Any apps that get broken as a consequence of this patch were
       written in a non-portable way, and therefore will break anyway
       when ran against ARM's or Nvidia's EGL library.
    2. "Non-portable" means, in my opinion, not only non-portable across
       different vendor's implementations of libEGL but also across
       versions of a single vendor's implementation. So, this patch does
       not violate any ABI contract provided Mesa's libEGL.

So, I give it
Reviewed-by: Chad Versace <chad.versace at intel.com>

> Gents,
> Considering your experience with mesa and other vendors' EGL
> implementations would you envision any conflicts that this may cause ?

> Cc: Brian Paul <brianp at vmware.com>
> Cc: Chad Versace <chad.versace at intel.com>
> Cc: Daniel Kurtz <djkurtz at chromium.org>
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
> ---
>  src/egl/main/eglapi.c      | 265 ++++++++++++++++++++++-----------------------
>  src/egl/main/egltypedefs.h |   2 -
>  2 files changed, 132 insertions(+), 135 deletions(-)

More information about the mesa-dev mailing list