[Mesa-dev] Undefined reference in libGLES when shared glapi is disabled

Emil Velikov emil.l.velikov at gmail.com
Mon Apr 28 18:04:25 PDT 2014


On 28/04/14 22:56, Eric Le Bihan wrote:
> Hi!
> 
> I'm currently cross-compiling Mesa3d for embedded systems using the
> following configure options:
> 
>  --enable-shared  --disable-glx --disable-xa --disable-static
>  --with-gallium-drivers=svga --disable-dri --disable-shared-glapi
>  --without-dri-drivers --enable-opengl --disable-gbm --disable-egl
>  --enable-gles1 --enable-gles2
> 
I seem to recall making a patch that explicitly requires shared glapi whenever
more than one GL api is built. Do you have some local patches that hack around
that ?

> So: no DRI, GALLIUM3D drivers, GLES only and no shared glapi. The build is
> successful, but when trying to link another program to libGLESv2.so, I get an
> undefined reference to _glapi_get_dispatch().
> 
> Looking at src/mapi/es2api/Makefile.am, I can see that, when
> --disable-shared-glapi is passed, the libglapi is not added as dependency:
> 
>   if HAVE_SHARED_GLAPI
>     libGLESv2_la_LIBADD += ../shared-glapi/libglapi.la
>   endif
> 
> But unfortunately it does not seem to be handled in src/mapi/entry.c, which is
> used to build libGLESv{1,2}.so and libglapi.so. In this file, we have:
> 
>   /* in bridge mode, mapi is a user of glapi */
>   #ifdef MAPI_MODE_BRIDGE
>   #define ENTRY_CURRENT_TABLE_GET "_glapi_get_dispatch"
>   #else
>   #define ENTRY_CURRENT_TABLE_GET U_STRINGIFY(u_current_get_internal)
>   #endif
> 
> When comparing src/mapi/glapi/Makefile.am and src/map/es2api/Makefile.am, I
> can see that, when passing --disable-shared-glapi, MAPI_MODE_BRIDGE is handled
> differently. For libGLESv2.so, entry.c will be compiled with
> -DMAPI_MODE_BRIDGE, hence the reference to _glapi_get_dispatch().
> 
> I tried to pass -DMAPI_MODE_BRIDGE only if HAVE_SHARED_GLAPI is true for
> libGLESv2, but ended with an error about MAPI_ABI_HEADER not being defined.
> 
> So, why is MAPI_MODE_BRIDGE handled differently? Is it forbidden to build
> libGLES with shared glapi disabled?
> 
While I cannot comment on the dispatch code, I would recommend that you use
shared glapi. That seems to be general consensus of developers.

-Emil

> Best regards,
> ELB
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 



More information about the mesa-dev mailing list