ndk-patches: Don't declare `sem_{open,close,unlink}`

but instead declare `libandroid_sem_{open,close,unlink}` defined in
`libandroid-posix-semaphore`.
This commit is contained in:
Tee KOBAYASHI 2022-03-25 21:34:38 +09:00 committed by xtkoba
parent 7d22b52637
commit 2a1524d67c
2 changed files with 19 additions and 1 deletions

View File

@ -0,0 +1,18 @@
--- ./usr/include/semaphore.h.orig
+++ ./usr/include/semaphore.h
@@ -71,9 +71,14 @@
int sem_trywait(sem_t* __sem);
int sem_wait(sem_t* __sem);
-/* These aren't actually implemented. */
+#undef sem_open
+#define sem_open libandroid_sem_open
sem_t* sem_open(const char* __name, int _flags, ...);
+#undef sem_close
+#define sem_close libandroid_sem_close
int sem_close(sem_t* __sem);
+#undef sem_unlink
+#define sem_unlink libandroid_sem_unlink
int sem_unlink(const char* __name);
__END_DECLS

View File

@ -2,7 +2,7 @@ termux_step_start_build() {
TERMUX_STANDALONE_TOOLCHAIN="$TERMUX_COMMON_CACHEDIR/android-r${TERMUX_NDK_VERSION}-api-${TERMUX_PKG_API_LEVEL}"
# Bump the below version if a change is made in toolchain setup to ensure
# that everyone gets an updated toolchain:
TERMUX_STANDALONE_TOOLCHAIN+="-v8"
TERMUX_STANDALONE_TOOLCHAIN+="-v9"
# shellcheck source=/dev/null
source "$TERMUX_PKG_BUILDER_SCRIPT"