Add builds to the CI script that use the TSD dispatch stubs, but use the
TLS variable in u_current_tls.c for the dispatch table.
That's the combination you'd get with musl or other non-glibc systems.
Add a 'dispatch-tls' option. Setting the option to false will force it
to use the TSD dispatch stubs for builds that would otherwise support
the TLS stubs.
This is mostly for test coverage, to make it easier to test builds that
use the __thread variable (u_current_tls.c), but still use the TSD
dispatch stubs.
Change the 'tls' option to be a boolean value instead of a feature.
This still allows manually disabling TLS in builds that would otherwise
support it, but it shouldn't be affected by meson's --auto-features
option.
TLSDESC speeds up access to global-dynamic TLS. TLS asm stubs do not
support TLSDESC, but all accesses are to initial-exec symbols anyways,
so it is not necessary to handle that separately.
It is not portable to use initial-exec TLS in dlopened libraries. glibc
and FreeBSD allocate extra memory for extra initial-exec variables
specifically for libGL, but other libcs including musl do not.
Since TLS entry asm assumes IE TLS, use TSD asm in other cases. Update
autoconf to match meson logic: enable ELF TLS if it is supported,
regardless of which type of asm is being used.
Previously, relative ICD paths were treated as being relative to the
current working directory, but this doesn't seem useful in practice:
EGL vendors cannot predict what the current working directory of EGL
applications is going to be.
Instead, interpret the path as being relative to the realpath() of the
JSON manifest describing the ICD.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Resolves: https://gitlab.freedesktop.org/glvnd/libglvnd/-/issues/190
When libGLX.so is unloaded, call XESetCloseDisplay to remove the display close
callback for any displays that still exist.
Otherwise, if libGLX.so is loaded using dlopen, and then unloaded while a
display is still open, then XCloseDisplay would try to call the (now dangling)
callback.
Added a --disable-entrypoint-tracking configure option and an
'entrypoint-patching' meson option to disable libGLdispatch's entrypoint
patching at build time.
If entrypoint patching is disabled, then it #ifdef's out the mprotect call, and
acts as if mprotect had failed, which causes libGLdispatch to skip trying to
perform any patching.
Fixes https://gitlab.freedesktop.org/glvnd/libglvnd/-/issues/217
Change the glXMakeCurrentTestResults function so that it returns the function
counts in a caller-allocated struct instead of calling malloc internally.
Also removed the GLmakeCurrentTestRequest enum, since there's only one request
anymore.
Aside from simplifying things, this also fixes a memory leak in
testglxmakecurrent, which wasn't freeing the buffer that
glXMakeCurrentTestResults allocated. Now, it can just use a stack-allocated
GLContextCounts struct.
In OnDisplayClosed, unlock the __glXDisplayInfoHash lock before locking
glxContextHashLock.
In CommonMakeCurrent, it holds glxContextHashLock while it tries to take the
__glXDisplayInfoHash lock, so if CommonMakeCurrent and OnDisplayClosed run at
the same time, they could deadlock.
To avoid that, OnDisplayClosed will set a new inTeardown flag in the
__GLXdisplayInfoHash, then it will unlock the display hash before calling
__glXDisplayClosed.
After __glXDisplayClosed is finished, OnDisplayClosed will lock
__glXDisplayInfoHash again long enough to remove the display from the
hashtable.
The inTeardown flag tells __glXLookupDisplay to return NULL, since after that
point, nothing should be trying to look up the display. In principle, we could
just remove the display from the hashtable up front, but then if something did
try to look up the display, then __glXLookupDisplay would try to create a new
__GLXdisplayInfo for it.
Fixes https://gitlab.freedesktop.org/glvnd/libglvnd/-/issues/213
Currently, in InitDeviceListInternal if any egl vendor fails to list
its devices for any reason the construction of the device list is
abandoned. That means that even if we have one vendor successfully
serving the application, the failure of another vendor library will
break any api calls related to egl devices.
Instead, if a vendor fails queryDevicesEXT the device mapping logic
should proceed as if it listed no devices. If the relevant device
belongs to the failed vendor then the dispatch will still fail with
EGL_BAD_DEVICE.
Add .arm and .thumb directives before and after the ARMv7 GLX dispatch stubs.
The function addresses that get passed around don't take Thumb into account, so
if they're compiled as Thumb, then they'd still get executed as ARM, which
would cause them to crash a SIGILL.
The set of warnings emitted are dependent on compiler version,
optimization level, CPU architecture, dependency versions, etc. It's not
tractable for a code base to be warning free under all circumstances,
and it's widely agreed that -Werror should not be enabled by default.
Given that it's trivial for developers to enable -Werror for autotools
by settings CFLAGS=-Werror and for meson with -Dwerror=true we should
not enable -Werror by default and require builders to disable it.
See https://devmanual.gentoo.org/ebuild-writing/common-mistakes/index.html#-werror-compiler-flag-not-removed
Reviewed-by: Eric Anholt <eric@anholt.net>