libglvnd/src/GL/Makefile.am

88 lines
2.9 KiB
Makefile
Raw Normal View History

# 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.
lib_LTLIBRARIES = libGL.la
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
TOP = $(top_srcdir)
MAPI = $(top_srcdir)/$(MAPI_PREFIX)
GLAPI = $(MAPI)/glapi
include $(top_srcdir)/src/GLdispatch/vnd-glapi/entry_files.mk
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
libGL_la_SOURCES = \
libgl.c \
g_libglglxwrapper.c
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
if HAVE_PYTHON
BUILT_SOURCES = g_libglglxwrapper.c
CLEANFILES = $(BUILT_SOURCES)
glapi_gen_glx_xml := \
$(top_srcdir)/src/generate/xml/glx.xml \
$(top_srcdir)/src/generate/xml/glx_other.xml
glapi_gen_libglglxstubs_script = $(top_srcdir)/src/generate/gen_libgl_glxstubs.py
glapi_gen_libglglxstubs_deps = \
$(glapi_gen_libglglxstubs_script) \
$(top_srcdir)/src/generate/genCommon.py \
$(glapi_gen_glx_xml)
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
g_libglglxwrapper.c : $(glapi_gen_libglglxstubs_deps)
$(AM_V_GEN)$(PYTHON) $(PYTHON_FLAGS) $(glapi_gen_libglglxstubs_script) $(glapi_gen_glx_xml) > $@
endif
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
AM_TESTS_ENVIRONMENT = \
TOP_SRCDIR='$(top_srcdir)' \
TOP_BUILDDIR='$(top_builddir)' \
NM='$(NM)' \
PYTHON='$(PYTHON)'
TESTS = gl-symbol-check.sh
libGL_la_CFLAGS = \
-I$(top_srcdir)/include
libGL_la_LDFLAGS = -shared -version-info 8:0:7 $(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
AM_CPPFLAGS = \
-I$(TOP)/src/GLdispatch/vnd-glapi \
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
-I$(TOP)/src/GLX \
-I$(TOP)/src/GLdispatch \
-I$(TOP)/src/util
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
libGL_la_LIBADD = ../GLX/libGLX.la
libGL_la_LIBADD += ../GLdispatch/libGLdispatch.la
libGL_la_LIBADD += ../GLdispatch/vnd-glapi/libglapi_gl.la
libGL_la_LIBADD += ../util/libutils_misc.la
libGL_la_LIBADD += @LIB_DL@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = gl.pc
EXTRA_DIST = \
gl-symbol-check.sh \
gl.symbols \
meson.build