From 2a1524d67cebd5e9e05aa9c909c20b8cae6a305e Mon Sep 17 00:00:00 2001 From: Tee KOBAYASHI Date: Fri, 25 Mar 2022 21:34:38 +0900 Subject: [PATCH] ndk-patches: Don't declare `sem_{open,close,unlink}` but instead declare `libandroid_sem_{open,close,unlink}` defined in `libandroid-posix-semaphore`. --- ndk-patches/semaphore.h.patch | 18 ++++++++++++++++++ scripts/build/termux_step_start_build.sh | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 ndk-patches/semaphore.h.patch diff --git a/ndk-patches/semaphore.h.patch b/ndk-patches/semaphore.h.patch new file mode 100644 index 0000000000..0955488179 --- /dev/null +++ b/ndk-patches/semaphore.h.patch @@ -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 diff --git a/scripts/build/termux_step_start_build.sh b/scripts/build/termux_step_start_build.sh index f5d381559f..80e7c028ab 100644 --- a/scripts/build/termux_step_start_build.sh +++ b/scripts/build/termux_step_start_build.sh @@ -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"