[Mesa-dev] [PATCH 2/2] mesa: dri: Add shared glapi to LIBADD on Android
drinkcat at chromium.org
Mon May 23 02:20:26 UTC 2016
On Thu, Apr 28, 2016 at 10:41 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> On 28 April 2016 at 11:41, Nicolas Boichat <drinkcat at chromium.org> wrote:
>> /system/vendor/lib/dri/*_dri.so actually depend on libglapi: without
>> this, loading the so file fails with:
>> cannot locate symbol "__emutls_v._glapi_tls_Context"
>> On non-Android (non-bionic) platform, EGL uses the following
>> workflow, which works fine:
>> dlopen("libglapi.so", RTLD_LAZY | RTLD_GLOBAL);
>> dlopen("dri/<driver>_dri.so", RTLD_NOW | RTLD_GLOBAL);
>> However, bionic does not respect the RTLD_GLOBAL flag, and the dri
>> library cannot find symbols in libglapi.so, so we need to link
>> to libglapi.so explicitly. Android.mk already does this.
> Ideally we'll soon be able to do a similar thing for the Linux binaries.
Great! This was quite tricky to debug... (and understand the logic...)
>> Signed-off-by: Nicolas Boichat <drinkcat at google.com>
>> src/mesa/drivers/dri/Makefile.am | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>> diff --git a/src/mesa/drivers/dri/Makefile.am b/src/mesa/drivers/dri/Makefile.am
>> index 08a8e64..0589bac 100644
>> --- a/src/mesa/drivers/dri/Makefile.am
>> +++ b/src/mesa/drivers/dri/Makefile.am
>> @@ -6,6 +6,13 @@ MEGADRIVERS_DEPS =
>> +# On Android, we need to explicitely link to libglapi.so.
> Typo "explicitly" - I can fix that before pushing.
> We want a similar patch for the gallium dri modules, correct ?
> (The ones in src/gallium/targets/dri/Makefile.am)
Probably, I haven't tried gallium. I know Tomasz (cc-ed) is trying to
get it running.
> Both patches look good and are
> Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
More information about the mesa-dev