Remove the "If only executable code is distributed..." paragraph from
the license text. Everything now uses a normal MIT license.
The only code from Khronos that's included in libglvnd is the EGL/GL
header and XML files, which do not contain that paragraph.
Fixes https://gitlab.freedesktop.org/glvnd/libglvnd/-/issues/221
Removed the rest of the assembly code generation from libGLdispatch. Since we
don't need to generate dispatch stubs at runtime for extension functions
anymore, the code generation is now only used to restore the dispatch stubs
after a vendor library patches them.
Now, instead of reconstructing each dispatch stub, libGLdispatch will just
allocate a copy of all of the entrypoints before patching them, and then it
uses memcpy to restore them.
libGL.so now looks up the GLX core functions using a simple table, so that it
doesn't have the overhead of looking them up by name every time it's loaded.
Removed the (mutex != NULL) checks from __glXGLLoadGLXFunction, since it's no
longer called without a mutex.
Removed __glXWrapperInit, since it doesn't do anything anymore. Also removed the header file libgl.h, which only contained the declaration for __glXWrapperInit.
Added a new script to generate the GLX entrypoints in libGL. The new script
uses Khronos's glx.xml file for a function list.
Checked in a copy of Khronos's glx.xml, from revision 32184.
In libGLdispatch, initialize the pthreads table in a constructor function so
that we can use the dispatch mutex in __glDispatchInit.
In __glDispatchFini, check whether clientRefcount has dropped to zero before
tearing everything down.
libGL and libOpenGL will now call __glDispatchFini when they're unloaded, since
they also call __glDispatchInit.
The pthreadFuncs variable is actually referenced from the files that go into
libGL and libOpenGL, even though none of the functions that reference it are
used. That can lead to unresolved symbol errors.
- Add a config check for ((constructor)) and ((destructor)) funciton
attributes.
- Add missing GL/glxmd.h header.
- For sufficiently old gcc versions, revert to inline asm
implementations of Atomic{Increment,Swap,CompareAndSwap}()
- Add a local implementation of asprintf.
- entry_x86_tsd.h: Add missing cast to (char *) in entry_get_public
- glvnd_pthread.[ch]: Only use pthread_rwlock_t if it's available, and fall
back to pthread_mutex_t otherwise.
- trace.c: Add missing _GNU_SOURCE define
- uthash.h: Fix a -Wcast-qual warning
- x11glvndclient.c: Fix a -Wcast-qual warning by using a writable
array for storing the XGLV_EXTENSION_NAME
Based on a patch by Brian Nguyen.
This re-naming should help avoid confusion with the terminology used
to describe vendor library re-writing of entrypoints, also known as
"patching". This function is called once at initialization time for
certain (e.g. x86_tls) TLS models.
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>