diff --git a/README.md b/README.md index a97e5f3f4..53082685e 100644 --- a/README.md +++ b/README.md @@ -126,9 +126,8 @@ Common porting problems * Android uses a customized version of shared memory managemnt known as ashmem. libandroid-shmem wraps SYSV shared memory calls to standard ashmem operations. Use it with `LDFLAGS+=" -landroid-shmem`. -* SYSV semaphore libc wrappers (semget(2), semop(2) and others) aren't available. Direct syscalls can be used with - `CFLAGS+=" -DTERMUX_SEMOPS_STUBS=1"`. Using this requires privelege escalation i.e. only root can do it. Use - unnamed POSIX semaphores instead (named semaphores are unimplemented). +* SYSV semaphores (semget(2), semop(2) and others) aren't available. + Use unnamed POSIX semaphores instead (named semaphores are unimplemented). dlopen() and RTLD_* flags ================================= diff --git a/build-package.sh b/build-package.sh index ea7530aec..2df9b50b0 100755 --- a/build-package.sh +++ b/build-package.sh @@ -218,7 +218,7 @@ termux_step_setup_variables() { TERMUX_STANDALONE_TOOLCHAIN="$TERMUX_TOPDIR/_lib/toolchain-${TERMUX_ARCH}-ndk${TERMUX_NDK_VERSION}-api${TERMUX_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+="-v16" + TERMUX_STANDALONE_TOOLCHAIN+="-v17" export TERMUX_TAR="tar" export TERMUX_TOUCH="touch" @@ -564,8 +564,9 @@ termux_step_setup_toolchain() { # ifaddrs.h: Added in android-24 unified headers, use a inline implementation for now. cp "$TERMUX_SCRIPTDIR"/ndk_patches/{elf.h,sysexits.h,ifaddrs.h} $_TERMUX_TOOLCHAIN_TMPDIR/sysroot/usr/include - # Remove from the NDK in favour of that from the libandroid-shmem: - rm $_TERMUX_TOOLCHAIN_TMPDIR/sysroot/usr/include/sys/shm.h + # Remove from the NDK in favour of that from the libandroid-shmem. + # Also remove as it doesn't work for non-root. + rm $_TERMUX_TOOLCHAIN_TMPDIR/sysroot/usr/include/sys/{shm.h,sem.h} local _LIBDIR=usr/lib if [ $TERMUX_ARCH = x86_64 ]; then _LIBDIR+=64; fi diff --git a/disabled-packages/postgresql/build.sh b/disabled-packages/postgresql/build.sh index f549bbd49..234612adf 100644 --- a/disabled-packages/postgresql/build.sh +++ b/disabled-packages/postgresql/build.sh @@ -15,8 +15,5 @@ USE_UNNAMED_POSIX_SEMAPHORES=1 TERMUX_PKG_EXTRA_MAKE_ARGS=" -s" termux_step_pre_configure () { - # to use shmem and sem stubs - CFLAGS+=" -DTERMUX_SEMOPS_STUBS=1" LDFLAGS+=" -llog" } - diff --git a/ndk_patches/sys-sem.h.patch b/ndk_patches/sys-sem.h.patch deleted file mode 100644 index dea3b8501..000000000 --- a/ndk_patches/sys-sem.h.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- /home/vishal/Android/Sdk/ndk-bundle/platforms/android-21/arch-arm/usr/include/sys/sem.h 2016-10-12 15:11:58.000000000 +0530 -+++ ./usr/include/sys/sem.h 2017-01-24 08:23:25.150726158 +0530 -@@ -31,4 +31,14 @@ - - #include - -+#ifdef TERMUX_SEMOPS_STUBS -+ -+#include -+ -+#define semop(semid, sops, nsops) syscall(__NR_semop, semid, sops, nsops) -+#define semget(key, nsems, semflg) syscall(__NR_semget, key, nsems, semflg) -+#define semctl(semid, semnum, cmd, ...) syscall(__NR_semctl, semid, semnum, cmd, __VA_ARGS__) -+ -+#endif /* TERMUX_SEMOPS_STUBS */ -+ - #endif /* _SYS_SEM_H_ */