The entrypointExec address is modified before being passed to
clear_cache function. We do a small add/subtract for ARMv7 in
order to enable Thumb mode. This is not required for Aarch64 as
it does not support Thumb mode. Since we were not adding anything,
do not subtract as well before passing the address to clear_cache.
This was causing a crash while calling glXGetProcAddress.
We don't need to save and restore r12 across the call to _glapi_get_current.
It's only used for function linkage, and the dispatch stub overwrites the value
a few instructions later anyway.
We can't use a simple ld instruction for a slot greater than or equal to 4096,
because the offset no longer fits in the signed 16-bit offset field.
Instead, use an addis instruction to deal with the high-order bits in the
offset.
Call _glapi_get_current through the PLT call stub. The PLT call stub takes care
of saving the TOC pointer.
Also rearranged the assembly code to remove the need for a backwards jump after
calling _glapi_get_current.
In GL/gl.h, remove PFNGLBLENDCOLORPROC, PFNGLBLENDEQUATIONPROC, and the
GL_OES_EGL_image section.
PFNGLBLENDCOLORPROC and PFNGLBLENDEQUATIONPROC are defined in GL/glext.h in the
GL_VERSION_1_4 section.
GL_OES_EGL_image is defined in GLES/glext.h and GLES2/gl2ext.h, and the
GLeglImageOES typedef is also defined in GL/glext.h under
GL_EXT_EGL_image_storage.
This is important for testing the TSD stubs, which have a separate fast path
for single-threaded programs.
The TSD stubs start with a simple global variable to hold the dispatch table
so that a single-threaded program doesn't have to deal with the overhead of
calling pthread_getspecific. When a second thread comes along, it sets that
variable to NULL, which makes the stubs call pthread_getspecific instead.
This change adds a flag to the testgldispatch test program that tells it to
call into libGLdispatch from two threads to force it into its multi-threaded
mode.
It also adds three new test scripts, which are the same testgldispatch tests
but for the multithreaded path.
In __glDispatchCheckMultithreaded, don't unlock the mutex until after calling
stubCurrentPatchCb->threadAttach.
Without that lock, another thread could come along and change
stubCurrentPatchCb out from under it.
An added advantage to this is that it makes it really easy to build with
Python 3, the same way other Autotools projects support it:
$ export PYTHON=/usr/bin/python3
$ ./configure
Remove FindProcIndex, __eglSetDispatchIndex, and
__eglDispatchFindDispatchFunction from egldispatchstubs.c.
The dispatch indices are allocated and assigned during initialization, so none
of those functions are ever called.
Don't point nonst_HEADERS or EXTRA_DIST at entire directories. That causes
"make dist" to include files that it shouldn't, such as configured makefiles
and .pyc files.
Also added a few generated header files to noinst_HEADERS.
The -export-symbols option in libtool creates a version script on Linux, but
on FreeBSD it instead uses the -retain-symbols-file option, which doesn't do
anything with the dynamic symbol table.
Instead, manually pass the --version-script option to the linker.
Various fixes so that libglvnd can build and run on FreeBSD.
The only change to C code is to deal with a difference in the parameters for
mincore(2).
Most of the rest is to to remove the dependency on GNU make and bash.
The third parameter to mincore(2) can be a pointer to char or unsigned char,
depending on what system it's building on. To build in either case, just cast
that argument to a (void *).
Add an AC_CHECK_FUNC call to check whether dlopen is available without any
additional libraries. Some systems provide dlopen as part of libc, in which
case we can't (and don't need to) link against libdl.so.
Generating a symbol list for the entrypoint libraries used to be necessary when
we generated the same set of dispatch stubs in each library.
Since then, we only generate the stubs that each library is going to export, so
we don't need a separate export list anymore.
Don't generate g_glapi_mapi_gl_tmp.h in the libGL makefile. That's not needed
anymore, because all of the GLDispatch stuff is built separately under
src/GLdispatch/vnd-glapi.
Likewise, remove the STATIC_DISPATCH_ONLY define from the compiler flags.
When dlsym is handed an address in a shared object that doesn't match a symbol
in that shared object (such as a C++ vtable) it returns success but sets
dli_sname to null.
Handle this case rather than crashing.
Older versions of glxproto.h contained a typo where "Attribs" was misspelled.
The typo was fixed in the xorgproto version of glxproto.h, breaking the API.
Fixes#149.
If libglvnd is installed onto a system that already has non-libglvnd versions
of any of the OpenGL libraries installed, then ldconfig can get confused about
which files to create symlinks to. At worst, you could end up with a mix of the
libglvnd libraries and leftover non-libglvnd libraries.
To avoid that, bump the version numbers in these filenames:
- libGL.so.1.0.0 -> libGL.so.1.7.0
- libGLESv1_CM.so.1.0.0 -> libGLESv1_CM.so.1.2.0
- libGLESv2.so.2.0.0 -> libGLESv2.so.2.1.0
- libEGL.so.1.0.0 -> libEGL.so.1.1.0
Fixes https://github.com/NVIDIA/libglvnd/issues/147
In u_execmem.c, use entry_stub_size and MAPI_TABLE_NUM_DYNAMIC to determine how
much executable memory to allocate, instead of just hard-coding 256KB.
The stubs on some architectures are larger than 64 bytes, so 256KB isn't always
going to be large enough, and it's wasteful on architectures with stubs that
are smaller than 64 bytes.
Remove the #ifdefs and the Win32 and malloc-based code from u_execmem.c. It's
not needed or used anymore, and even if it was, the allocation code is in
src/utils/utils_misc.c now.
In testglxmakecurrent, remove the paths to test using glXCreateNewContext and
glXCreateContextAttribsARB.
The testglxcreatecontext test now tests the various context creation functions,
so we don't need to shoehorn them into testglxmakecurrent.
Add a new test, testglxcreatecontext to test the various functions for creating
GLX contexts.
It tests the core GLX functions, the GLX_ARB_create_context and
GLX_EXT_no_config_context extensions, and using a vendor-provided extension
function.
The new test is much simpler than trying to use testglxmakecurrent to test both
context creation and MakeCurrent, especially for trying to test multiple
context creation functions.
Added a glXCreateContextVendorDUMMY extension function to GLX_dummy to test
using a vendor-provided extension function to create a context. We can't use
glXCreateContextAttribsARB for that now, because it has a dispatch stub in
libGLX itself.
glXCreateContextVendorDUMMY takes the same arguments as
glXCreateContextAttribsARB, so it can also serve as an example for implementing
a dispatch stub for glXCreateContextAttribsARB in a real vendor library.