Browse Source

Make it possible to opt in to _FILE_OFFSET_BITS=64

android-5
Fredrik Fornwall 8 years ago
parent
commit
4e9a8b45eb
  1. 2
      build-package.sh
  2. 24
      ndk-patches/sys-cdefs.h.patch

2
build-package.sh

@ -446,7 +446,7 @@ termux_step_setup_toolchain() {
TERMUX_STANDALONE_TOOLCHAIN="$TERMUX_TOPDIR/_lib/${TERMUX_NDK_VERSION}-${TERMUX_ARCH}-${TERMUX_PKG_API_LEVEL}" TERMUX_STANDALONE_TOOLCHAIN="$TERMUX_TOPDIR/_lib/${TERMUX_NDK_VERSION}-${TERMUX_ARCH}-${TERMUX_PKG_API_LEVEL}"
# Bump the below version if a change is made in toolchain setup to ensure # Bump the below version if a change is made in toolchain setup to ensure
# that everyone gets an updated toolchain: # that everyone gets an updated toolchain:
TERMUX_STANDALONE_TOOLCHAIN+="-v6" TERMUX_STANDALONE_TOOLCHAIN+="-v7"
# We put this after system PATH to avoid picking up toolchain stripped python # We put this after system PATH to avoid picking up toolchain stripped python
export PATH=$PATH:$TERMUX_STANDALONE_TOOLCHAIN/bin export PATH=$PATH:$TERMUX_STANDALONE_TOOLCHAIN/bin

24
ndk-patches/sys-cdefs.h.patch

@ -1,17 +1,19 @@
diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/sys/cdefs.h ./usr/include/sys/cdefs.h diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/sys/cdefs.h ./usr/include/sys/cdefs.h
--- /home/fornwall/lib/android-ndk/sysroot/usr/include/sys/cdefs.h 2017-06-20 17:41:56.000000000 +0200 --- /home/fornwall/lib/android-ndk/sysroot/usr/include/sys/cdefs.h 2017-06-20 17:41:56.000000000 +0200
+++ ./usr/include/sys/cdefs.h 2017-07-07 03:27:59.327850834 +0200 +++ ./usr/include/sys/cdefs.h 2017-07-09 23:37:26.453911992 +0200
@@ -234,13 +234,6 @@ @@ -237,9 +237,15 @@
# define __USE_BSD 1 /* _FILE_OFFSET_BITS 64 support. */
#if !defined(__LP64__) && defined(_FILE_OFFSET_BITS)
#if _FILE_OFFSET_BITS == 64
+#ifdef TERMUX_EXPOSE_FILE_OFFSET64
+/* Using _FILE_OFFSET_BITS=64 does not work very well on Android
+ * and can cause problems when mixing libraries, which is why
+ * Termux hides away this unless TERMUX_EXPOSE_FILE_OFFSET64
+ * is defined. */
#define __USE_FILE_OFFSET64 1
#endif #endif
#endif
+#endif
-/* _FILE_OFFSET_BITS 64 support. */
-#if !defined(__LP64__) && defined(_FILE_OFFSET_BITS)
-#if _FILE_OFFSET_BITS == 64
-#define __USE_FILE_OFFSET64 1
-#endif
-#endif
-
#define __BIONIC__ 1 #define __BIONIC__ 1
#include <android/api-level.h> #include <android/api-level.h>

Loading…
Cancel
Save