Mesa (17.3): egl: link libEGL against the dynamic version of libglapi

Emil Velikov evelikov at kemper.freedesktop.org
Thu Jan 4 14:09:16 UTC 2018


Module: Mesa
Branch: 17.3
Commit: 1a7af3549fd45c7348a2a4fe9f7224ae8ad1faa1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1a7af3549fd45c7348a2a4fe9f7224ae8ad1faa1

Author: Brendan King <Brendan.King at imgtec.com>
Date:   Mon Dec 18 16:33:18 2017 +0000

egl: link libEGL against the dynamic version of libglapi

Note: the following happens only when using slibtool.
Since this is a very serious breakage, we will keep the workaround until
a better solution is available.

DRI modules store the address of the dispatch table in a TLS variable,
_glapi_tls_Dispatch.

Changes to the way libEGL is built in d884d8d0077c16d459b1 resulted in
it being statically linked against libglapi, and thus containing its own
copy of _glapi_tls_Dispatch. The result was that some applications would
fail to work (e.g. deqp-egl, which dynamically loads libEGL), due to the
DRI module storing the dispatch table address in one copy of
_glapi_tls_Dispatch, and libEGL obtaining the address from another copy
of the variable.

Fixes: d884d8d0077c16d459b1 "egl/dri: link directly to libglapi.so"
Signed-off-by: Brendan King <Brendan.King at imgtec.com>
Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
(cherry picked from commit e491bffc5c8da9fa0f7c08f78a7701ed5705d163)

---

 src/egl/Makefile.am | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
index eeb745f973..dd1d67ec86 100644
--- a/src/egl/Makefile.am
+++ b/src/egl/Makefile.am
@@ -46,7 +46,6 @@ libEGL_common_la_SOURCES = \
 	$(LIBEGL_C_FILES)
 
 libEGL_common_la_LIBADD = \
-	$(top_builddir)/src/mapi/shared-glapi/libglapi.la \
 	$(top_builddir)/src/util/libmesautil.la \
 	$(EGL_LIB_DEPS)
 
@@ -165,7 +164,9 @@ libEGL_mesa_la_SOURCES = \
 	main/egldispatchstubs.c \
 	g_egldispatchstubs.c \
 	g_egldispatchstubs.h
-libEGL_mesa_la_LIBADD = libEGL_common.la
+libEGL_mesa_la_LIBADD = \
+	libEGL_common.la \
+	$(top_builddir)/src/mapi/shared-glapi/libglapi.la
 libEGL_mesa_la_LDFLAGS = \
 	-no-undefined \
 	-version-number 0 \
@@ -177,7 +178,9 @@ else # USE_LIBGLVND
 
 lib_LTLIBRARIES = libEGL.la
 libEGL_la_SOURCES =
-libEGL_la_LIBADD = libEGL_common.la
+libEGL_la_LIBADD = \
+	libEGL_common.la \
+	$(top_builddir)/src/mapi/shared-glapi/libglapi.la
 libEGL_la_LDFLAGS = \
 	-no-undefined \
 	-version-number 1:0 \




More information about the mesa-commit mailing list