Android build broken (undefined symbol: pthread_getaffinity_np)
The Meson build system
Version: 0.59.2
Source dir: /home/stefan/mpv-android/buildscripts/deps/dav1d
Build dir: /home/stefan/mpv-android/buildscripts/deps/dav1d/_build-arm64
Build type: cross build
Project name: dav1d
Project version: 0.9.2
C compiler for the host machine: aarch64-linux-android21-clang (clang 12.0.5 "Android (7284624, based on r416183b) clang version 12.0.5 (https://android.googlesource.com/toolchain/llvm-project c935d99d7cf2016289302412d708641d52d2f7ee)")
C linker for the host machine: aarch64-linux-android21-clang ld.lld 12.0.5
C compiler for the build machine: cc (gcc 11.1.0 "cc (GCC) 11.1.0")
C linker for the build machine: cc ld.lld 12.0.5
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: aarch64
Host machine cpu: aarch64
Target machine cpu family: aarch64
Target machine cpu: aarch64
Run-time dependency threads found: YES
Checking for function "clock_gettime" : YES
Library dl found: YES
Checking for function "dlsym" with dependency -ldl: YES
Library m found: YES
Check usable header "stdatomic.h" : YES
Check usable header "unistd.h" : YES
Check usable header "io.h" : NO
Checking for function "getopt_long" : YES
Checking for function "_aligned_malloc" : NO
Checking for function "posix_memalign" : YES
Checking for function "getauxval" : YES
Checking for function "elf_aux_info" : NO
Compiler for C supports arguments -fvisibility=hidden: YES
Compiler for C supports arguments -Wundef: YES
Compiler for C supports arguments -Werror=vla: YES
Compiler for C supports arguments -Wno-maybe-uninitialized: NO
Compiler for C supports arguments -Wno-missing-field-initializers: YES
Compiler for C supports arguments -Wno-unused-parameter: YES
Compiler for C supports arguments -Wstrict-prototypes: YES
Compiler for C supports arguments -Werror=missing-prototypes: YES
Compiler for C supports arguments -Wshorten-64-to-32: YES
Compiler for C supports arguments -fomit-frame-pointer: YES
Compiler for C supports arguments -ffast-math: YES
Configuring config.h using configuration
Program /usr/bin/meson found: YES (/usr/bin/meson)
Configuring version.h using configuration
Program doxygen found: NO
Program dot found: YES (/usr/bin/dot)
Header <xxhash.h> has symbol "XXH3_createState" : NO
Configuring cli_config.h using configuration
Build targets in project: 10
Found ninja-1.10.2 at /usr/bin/ninja
ninja: Entering directory `_build-arm64'
[40/98] Compiling C object src/libdav1d.a.p/cpu.c.o
../src/cpu.c:97:10: warning: implicit declaration of function 'pthread_getaffinity_np' is invalid in C99 [-Wimplicit-function-declaration]
if (!pthread_getaffinity_np(pthread_self(), sizeof(affinity), &affinity))
^
1 warning generated.
[98/98] Linking target tools/dav1d
FAILED: tools/dav1d
aarch64-linux-android21-clang -o tools/dav1d tools/dav1d.p/dav1d.c.o tools/dav1d.p/dav1d_cli_parse.c.o -flto -flto-jobs=0 -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -Wl,--start-group src/libdav1d.a tools/libdav1d_input.a tools/libdav1d_output.a -pthread -lm -ldl -Wl,--end-group
ld: error: undefined symbol: pthread_getaffinity_np
>>> referenced by ld-temp.o
>>> lto.tmp:(dav1d_num_logical_processors)
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.