pulseaudio: fix dependencies for openssl-3
[oi-userland.git] / components / x11 / mesa / patches / patch-src_mapi_entry__x86-64__tls.h.patch
blob32d9c23225951203b1db969e2380a5237c75f53e
1 $NetBSD: patch-src_mapi_entry__x86-64__tls.h,v 1.6 2022/03/13 15:50:05 tnn Exp $
3 NetBSD only supports zero-initialized initial-exec tls variables in conjuction
4 with dlopen(3) at the moment.
6 table_noop_array is only defined for shared-glapi.
7 es1api and es2api are not going to be patched for NetBSD.
9 --- src/mapi/entry_x86-64_tls.h.orig 2021-07-14 20:04:57.805030000 +0000
10 +++ src/mapi/entry_x86-64_tls.h
11 @@ -38,22 +38,34 @@
12 #endif
14 __asm__(".text\n"
15 - ".balign 32\n"
16 + ".balign 64\n"
17 "x86_64_entry_start:");
19 #define STUB_ASM_ENTRY(func) \
20 ".globl " func "\n" \
21 ".type " func ", @function\n" \
22 - ".balign 32\n" \
23 + ".balign 64\n" \
24 func ":"
26 #ifndef __ILP32__
28 +#if defined(__NetBSD__)
29 +#define STUB_ASM_CODE(slot) \
30 + "movq " ENTRY_CURRENT_TABLE "@GOTTPOFF(%rip), %rax\n\t" \
31 + "movq %fs:(%rax), %r11\n\t" \
32 + "testq %r11, %r11\n\t" \
33 + "je 1f\n\t" \
34 + "jmp *(8 * " slot ")(%r11)\n\t" \
35 + "1:\n\t" \
36 + "callq " ENTRY_CURRENT_TABLE_GET "@PLT\n\t" \
37 + "jmp *(8 * " slot ")(%rax)"
38 +#else
39 #define STUB_ASM_CODE(slot) \
40 ENDBR \
41 "movq " ENTRY_CURRENT_TABLE "@GOTTPOFF(%rip), %rax\n\t" \
42 "movq %fs:(%rax), %r11\n\t" \
43 "jmp *(8 * " slot ")(%r11)"
44 +#endif
46 #else
48 @@ -85,7 +97,7 @@ x86_64_entry_start[] HIDDEN;
49 mapi_func
50 entry_get_public(int slot)
52 - return (mapi_func) (x86_64_entry_start + slot * 32);
53 + return (mapi_func) (x86_64_entry_start + slot * 64);
56 void