Commit graph

9 commits

Author SHA1 Message Date
yes,i Do 05f75de586 Add support for loongarch64. 2022-09-20 14:05:14 +00:00
Guillaume Gardet 7107f73939 Add BTI landing pads for aarch64
When Branch Target Identifier (BTI) is enabled on aarch64,
any software which run libglvnd will fail with SIGILL, Illegal instruction.
This is because some assembler code misses the BTI landing pads.
See: https://developer.arm.com/documentation/102433/0100/Jump-oriented-programming

"hint #34" is the same thing as "BTI C" landing pad, but keep
compatibility with systems without BTI enabled.
2022-02-24 16:21:52 +01:00
Kyle Brenneman a7bb6f4d19 Remove extra paragraph from license text.
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
2021-09-30 09:21:34 -06:00
Charlotte Delenk 97db5662c1
Mark entrypointFunctions as used for clang+lto
LLVM currently ignores inline assembly references to symbols during
dead code and data elimination while linking with link-time optimizations
enabled.

This manifests in a very large amount of unresolved references to
entrypointFunctions when building libglvnd using clang with LTO enabled.

This issue fixes #220 by marking the entrypointFunctions array as used,
using a compiler attribute.

Signed-off-by: Charlotte Delenk <darkkirb@darkkirb.de>
2021-09-20 18:48:28 +02:00
Kyle Brenneman 6cd95fbfe2 Add .arm directives for the GLX entrypoint stubs.
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.
2020-08-11 12:37:59 -06:00
q66 c31a7c06eb vnd-glapi: allow asm to be used on ELFv2 ppc64 big endian
These entry points are actually not little endian specific,
but they are specific to ELFv2 ABI. ELFv2 ABI can be used
on either little or big endian, and there are distributions
doing so (e.g. Void Linux, Adélie Linux) as well as other
OSes transitioning (FreeBSD).

These have been confirmed to work on a Power Mac G5 running
Void Linux.
2019-12-09 18:49:41 +01:00
Kyle Brenneman 6811a4bcc9 GLX: Add labels to the GLX entrypoint stubs. 2019-11-22 13:16:48 -07:00
Kyle Brenneman 50a0db2457 GLX: Define the GLX dispatch stubs at compile time.
Rewrote the generated dispatch stubs for GLX so that they're all defined at
compile time, instead of generating them at runtime.

Insted of patching the address of the vendor-provided functions into the
assembly stubs, it will now keep a separate array of function pointers. The
assembly stubs will look up the approprite entry in that array and jump to it.

As a result, the assembly code is entirely static, so we don't need to deal
with generating or modifying executable code at runtime.
2019-11-22 13:16:44 -07:00
Kyle Brenneman 4269cdcff4 Move glvnd_genentry into the GLX directory.
The glvnd_genentry code isn't used outside of GLX.
2019-11-22 08:38:16 -07:00
Renamed from src/util/glvnd_genentry.c (Browse further)