0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-09-27 06:14:56 +00:00
Files
termux-packages/packages/mesa/0011-lld-undefined-version.diff
Fredrik Fornwall a0037d1e8d fix(main/mesa): Fix build when targeting newer API level
Fix build errors when targeting a newer API level such as with:

    TERMUX_PKG_API_LEVEL=30 ./build-package.sh -i mesa

1: Change to only define reallocarray if API level < 29

Fixes the build error:

> reallocarray.h:44:1:
> error: static declaration of 'reallocarray' follows non-static declaration

2: Specify the Android API level to bindgen

Fixes the build error:

> Unable to generate bindings: clang diagnosed error:
> [..]/c++/v1/__condition_variable/condition_variable.h:226:14:
> error: use of undeclared identifier 'pthread_cond_clockwait'

3: Only patch in emulated TLS symbol names when if API level < 29

Fixes the build error:

> ld.lld: error: version script assignment of 'global' to
> symbol '__emutls_v._mesa_glapi_tls_Context' failed:
> symbol not defined
2025-09-13 19:12:05 +02:00

18 lines
728 B
Diff

`_mesa_glapi_tls_Context` and `_mesa_glapi_tls_Dispatch` is declared as thread_local.
Their symbol names will be `__emutls_v._mesa_glapi_tls_Context` and `__emutls_v._mesa_glapi_tls_Dispatch`
as emulated TLS is enabled by NDK when `__ANDROID_API__` <= 28.
--- a/src/gallium/targets/dri/dri.sym.in
+++ b/src/gallium/targets/dri/dri.sym.in
@@ -8,8 +8,8 @@
_mesa_glapi_get_proc_offset;
_mesa_glapi_set_context;
_mesa_glapi_set_dispatch;
- _mesa_glapi_tls_Context;
- _mesa_glapi_tls_Dispatch;
+ __emutls_v._mesa_glapi_tls_Context;
+ __emutls_v._mesa_glapi_tls_Dispatch;
ddebug_screen_create;
noop_screen_create;