2013-08-23 01:14:33 +02:00
|
|
|
# Copyright (c) 2013, NVIDIA CORPORATION.
|
|
|
|
#
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
# copy of this software and/or associated documentation files (the
|
|
|
|
# "Materials"), to deal in the Materials without restriction, including
|
|
|
|
# without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
# distribute, sublicense, and/or sell copies of the Materials, and to
|
|
|
|
# permit persons to whom the Materials are furnished to do so, subject to
|
|
|
|
# the following conditions:
|
|
|
|
#
|
|
|
|
# The above copyright notice and this permission notice shall be included
|
|
|
|
# unaltered in all copies or substantial portions of the Materials.
|
|
|
|
# Any additions, deletions, or changes to the original source files
|
|
|
|
# must be clearly indicated in accompanying documentation.
|
|
|
|
#
|
|
|
|
# If only executable code is distributed, then the accompanying
|
|
|
|
# documentation must state that "this software is based in part on the
|
|
|
|
# work of the Khronos Group."
|
|
|
|
#
|
|
|
|
# THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
|
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
|
|
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
|
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
|
|
# MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
|
|
|
|
2013-09-27 03:47:05 +02:00
|
|
|
noinst_HEADERS = \
|
2017-06-15 00:01:58 +02:00
|
|
|
glvnd_genentry.h \
|
2013-09-27 03:47:05 +02:00
|
|
|
libglxabipriv.h \
|
|
|
|
libglxcurrent.h \
|
|
|
|
libglxmapping.h \
|
Re-implement libGL such that ELF symbol filtering is optional
Unfortunately, glibc has a bug where dlopening a shared library with
DT_FILTER or DT_AUXILIARY ELF headers can cause the application to
segfault (see https://sourceware.org/bugzilla/show_bug.cgi?id=16272).
Hence, for now, we can't rely on ELF symbol filtering to implement the
libGL compatibility library for libGLdispatch and libGLX. This change
re-implements libGL such that this is no longer necessary, by building
in the glapi static dispatch stubs and implementing thin wrapper
functions around GLX entrypoints.
- Rename getCachedProcAddress() to __glXGetCachedProcAddress() and give
this public visibility. This is used by the libGL wrapper library to
retrieve GLX entrypoints at load time.
- Link libGLX with the -Bsymbolic flag so __glXGetCachedProcAddress()
avoids referencing functions in the libGL wrapper library when libGL
and libGLX are both loaded.
- Replace the hand-coded no-op definitions in libglxnoopdefs.h with
a spec file, glx_funcs.spec, and a simple Perl script, gen_stubs.pl,
which parses the file and generates no-op functions as well as
pass-through functions that are used by libGL.
- Restructure GLdispatch/vnd-glapi/mapi/entry.c such that the pure C
fallback code is in its own header, entry_pure_c.h. In each of the
entry_*.h headers, separate code not related to implementing the
static dispatch stubs into an "#if !defined(STATIC_DISPATCH_ONLY)"
block.
- Give u_current (which is #defined as _glapi_Current or
_glapi_tls_Current depending on the thread storage model used) public
visibility so it can be referenced from outside of libGLdispatch.so.
- When building libGL, include GLdispatch/vnd-glapi/mapi/entry.c in the
sources, and define STATIC_DISPATCH_ONLY so that only the static
entrypoints are compiled. Remove the -Wl,--auxiliary flags from
Makefile.am.
Bonus: fix "make distcheck" by adding GLdispatchABI.h to noinst_HEADERS.
Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
2013-12-03 21:06:47 +01:00
|
|
|
libglxgl.h \
|
2016-03-08 00:31:09 +01:00
|
|
|
libglxthread.h \
|
|
|
|
libglxproto.h
|
2013-09-27 03:47:05 +02:00
|
|
|
|
2013-08-23 01:14:33 +02:00
|
|
|
lib_LTLIBRARIES = libGLX.la
|
|
|
|
|
|
|
|
UTIL_DIR = ../util
|
2013-08-12 22:12:09 +02:00
|
|
|
UTHASH_DIR = ../util/uthash/src
|
2013-08-12 22:12:09 +02:00
|
|
|
GL_DISPATCH_DIR = ../GLdispatch
|
2013-08-23 01:20:01 +02:00
|
|
|
|
2013-08-23 01:14:33 +02:00
|
|
|
# Warning settings
|
|
|
|
# Include paths
|
2013-09-26 23:57:06 +02:00
|
|
|
libGLX_la_CFLAGS = -I$(srcdir)/$(UTHASH_DIR)
|
|
|
|
libGLX_la_CFLAGS += -I$(srcdir)/$(UTIL_DIR)
|
|
|
|
libGLX_la_CFLAGS += -I$(srcdir)/$(GL_DISPATCH_DIR)
|
|
|
|
libGLX_la_CFLAGS += -I$(top_srcdir)/include
|
2019-09-12 18:15:33 +02:00
|
|
|
libGLX_la_CFLAGS += $(GLPROTO_CFLAGS) $(X11_CFLAGS) $(XEXT_CFLAGS)
|
2013-08-23 01:14:33 +02:00
|
|
|
|
|
|
|
# Required library flags
|
|
|
|
libGLX_la_CFLAGS += $(PTHREAD_CFLAGS)
|
|
|
|
|
|
|
|
# Required libraries
|
2018-03-08 18:55:01 +01:00
|
|
|
libGLX_la_LIBADD = @LIB_DL@
|
2013-08-23 01:14:33 +02:00
|
|
|
libGLX_la_LIBADD += $(X11_LIBS)
|
|
|
|
libGLX_la_LIBADD += $(XEXT_LIBS)
|
2013-08-12 22:12:09 +02:00
|
|
|
libGLX_la_LIBADD += $(GL_DISPATCH_DIR)/libGLdispatch.la
|
2016-04-05 21:38:58 +02:00
|
|
|
libGLX_la_LIBADD += $(UTIL_DIR)/libtrace.la
|
2016-04-05 00:57:56 +02:00
|
|
|
libGLX_la_LIBADD += $(UTIL_DIR)/libglvnd_pthread.la
|
|
|
|
libGLX_la_LIBADD += $(UTIL_DIR)/libutils_misc.la
|
|
|
|
libGLX_la_LIBADD += $(UTIL_DIR)/libapp_error_check.la
|
2016-05-03 20:31:27 +02:00
|
|
|
libGLX_la_LIBADD += $(UTIL_DIR)/libwinsys_dispatch.la
|
2013-08-23 01:14:33 +02:00
|
|
|
|
2015-07-24 22:35:45 +02:00
|
|
|
libGLX_la_LDFLAGS = -shared -Wl,-Bsymbolic -version-info 0 $(LINKER_FLAG_NO_UNDEFINED)
|
Re-implement libGL such that ELF symbol filtering is optional
Unfortunately, glibc has a bug where dlopening a shared library with
DT_FILTER or DT_AUXILIARY ELF headers can cause the application to
segfault (see https://sourceware.org/bugzilla/show_bug.cgi?id=16272).
Hence, for now, we can't rely on ELF symbol filtering to implement the
libGL compatibility library for libGLdispatch and libGLX. This change
re-implements libGL such that this is no longer necessary, by building
in the glapi static dispatch stubs and implementing thin wrapper
functions around GLX entrypoints.
- Rename getCachedProcAddress() to __glXGetCachedProcAddress() and give
this public visibility. This is used by the libGL wrapper library to
retrieve GLX entrypoints at load time.
- Link libGLX with the -Bsymbolic flag so __glXGetCachedProcAddress()
avoids referencing functions in the libGL wrapper library when libGL
and libGLX are both loaded.
- Replace the hand-coded no-op definitions in libglxnoopdefs.h with
a spec file, glx_funcs.spec, and a simple Perl script, gen_stubs.pl,
which parses the file and generates no-op functions as well as
pass-through functions that are used by libGL.
- Restructure GLdispatch/vnd-glapi/mapi/entry.c such that the pure C
fallback code is in its own header, entry_pure_c.h. In each of the
entry_*.h headers, separate code not related to implementing the
static dispatch stubs into an "#if !defined(STATIC_DISPATCH_ONLY)"
block.
- Give u_current (which is #defined as _glapi_Current or
_glapi_tls_Current depending on the thread storage model used) public
visibility so it can be referenced from outside of libGLdispatch.so.
- When building libGL, include GLdispatch/vnd-glapi/mapi/entry.c in the
sources, and define STATIC_DISPATCH_ONLY so that only the static
entrypoints are compiled. Remove the -Wl,--auxiliary flags from
Makefile.am.
Bonus: fix "make distcheck" by adding GLdispatchABI.h to noinst_HEADERS.
Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
2013-12-03 21:06:47 +01:00
|
|
|
|
2017-06-15 00:37:21 +02:00
|
|
|
GENERATE_DISPATCH_STUBS_SCRIPT = $(top_srcdir)/src/GLX/gen_glx_stubs.py
|
|
|
|
EXTRA_DIST = $(GENERATE_DISPATCH_STUBS_SCRIPT)
|
|
|
|
|
|
|
|
if HAVE_PYTHON
|
|
|
|
g_glx_dispatch_stub_list.h: $(GENERATE_DISPATCH_STUBS_SCRIPT)
|
|
|
|
$(AM_V_GEN)$(PYTHON) $(GENERATE_DISPATCH_STUBS_SCRIPT) > $@
|
|
|
|
BUILT_SOURCES = g_glx_dispatch_stub_list.h
|
|
|
|
CLEANFILES = $(BUILT_SOURCES)
|
|
|
|
endif
|
|
|
|
|
2013-08-23 01:14:33 +02:00
|
|
|
libGLX_la_SOURCES = \
|
2013-08-23 01:21:31 +02:00
|
|
|
libglx.c \
|
2013-08-23 01:23:20 +02:00
|
|
|
libglxmapping.c \
|
2017-06-15 00:01:58 +02:00
|
|
|
libglxproto.c \
|
2017-06-15 00:37:21 +02:00
|
|
|
glvnd_genentry.c \
|
|
|
|
g_glx_dispatch_stub_list.h
|
2016-05-11 19:16:57 +02:00
|
|
|
|
2019-09-03 16:13:34 +02:00
|
|
|
pkgconfigdir = $(libdir)/pkgconfig
|
|
|
|
pkgconfig_DATA = glx.pc
|
2019-11-06 01:05:53 +01:00
|
|
|
|
|
|
|
AM_TESTS_ENVIRONMENT = \
|
|
|
|
TOP_SRCDIR='$(top_srcdir)' \
|
|
|
|
TOP_BUILDDIR='$(top_builddir)' \
|
|
|
|
NM='$(NM)' \
|
|
|
|
PYTHON='$(PYTHON)'
|
|
|
|
TESTS = glx-symbol-check.sh
|
|
|
|
|
|
|
|
EXTRA_DIST += \
|
|
|
|
glx-symbol-check.sh \
|
2019-11-05 22:22:31 +01:00
|
|
|
glx.symbols \
|
|
|
|
meson.build
|