Module: Mesa
Branch: master
Commit: 0cbc90c57cfc6099b529c5caeb58f385735ba75f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0cbc90c57cfc6099b529c5caeb58f385735ba75f

Author: Nicolas Boichat <drink...@chromium.org>
Date:   Thu Apr 28 18:41:39 2016 +0800

mesa: dri: Add shared glapi to LIBADD on Android

/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.

Signed-off-by: Nicolas Boichat <drink...@google.com>
Reviewed-by: Emil Velikov <emil.veli...@collabora.com>
[Emil Velikov: s/explicitely/explicitly/]
Signed-off-by: Emil Velikov <emil.veli...@collabora.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..1c6dd08 100644
--- a/src/mesa/drivers/dri/Makefile.am
+++ b/src/mesa/drivers/dri/Makefile.am
@@ -6,6 +6,13 @@ MEGADRIVERS_DEPS =
 
 SUBDIRS+=common
 
+# On Android, we need to explicitly link to libglapi.so.
+if HAVE_ANDROID
+if HAVE_SHARED_GLAPI
+SHARED_GLAPI_LIB = $(top_builddir)/src/mapi/shared-glapi/libglapi.la
+endif
+endif
+
 if HAVE_I915_DRI
 SUBDIRS += i915
 MEGADRIVERS_DEPS += i915/libi915_dri.la
@@ -61,6 +68,7 @@ mesa_dri_drivers_la_LIBADD = \
         common/libmegadriver_stub.la \
         common/libdricommon.la \
         common/libxmlconfig.la \
+        $(SHARED_GLAPI_LIB) \
         $(MEGADRIVERS_DEPS) \
         $(DRI_LIB_DEPS) \
         $()

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to