ndk-20 update
This commit is contained in:
parent
ae1f88bad3
commit
5eada22838
|
@ -1,10 +1,9 @@
|
||||||
diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/bits/struct_file.h ./usr/include/bits/struct_file.h
|
--- ./usr/include/bits/struct_file.h.orig 2019-06-10 09:40:35.872857650 +1000
|
||||||
--- /home/fornwall/lib/android-ndk/sysroot/usr/include/bits/struct_file.h 2017-06-20 17:41:56.000000000 +0200
|
+++ ./usr/include/bits/struct_file.h 2019-06-10 09:55:10.890308649 +1000
|
||||||
+++ ./usr/include/bits/struct_file.h 2017-06-26 13:35:19.040117023 +0200
|
@@ -31,14 +31,79 @@
|
||||||
@@ -33,13 +33,80 @@
|
#include <sys/cdefs.h>
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
|
|
||||||
+#if defined(__LP64__)
|
+#if defined(__LP64__)
|
||||||
+struct __sbuf {
|
+struct __sbuf {
|
||||||
+ unsigned char* _base;
|
+ unsigned char* _base;
|
||||||
|
@ -13,75 +12,74 @@ diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/bits/struct_file.h
|
||||||
+#else
|
+#else
|
||||||
+struct __sbuf {
|
+struct __sbuf {
|
||||||
+ unsigned char *_base;
|
+ unsigned char *_base;
|
||||||
+ int _size;
|
+ int _size;
|
||||||
+};
|
+};
|
||||||
+#endif
|
+#endif
|
||||||
+
|
|
||||||
+#if defined(__LP64__)
|
+#if defined(__LP64__)
|
||||||
+typedef int64_t _struct_file_off_t;
|
+typedef int64_t _struct_file_off_t;
|
||||||
+#else
|
+#else
|
||||||
+typedef __kernel_off_t _struct_file_off_t;
|
+typedef __kernel_off_t _struct_file_off_t;
|
||||||
+#endif
|
+#endif
|
||||||
+
|
+
|
||||||
|
|
||||||
|
/** The opaque structure implementing `FILE`. Do not make any assumptions about its content. */
|
||||||
struct __sFILE {
|
struct __sFILE {
|
||||||
+ unsigned char *_p; /* current position in (some) buffer */
|
+ unsigned char *_p; /* current position in (some) buffer */
|
||||||
+ int _r; /* read space left for getc() */
|
+ int _r; /* read space left for getc() */
|
||||||
+ int _w; /* write space left for putc() */
|
+ int _w; /* write space left for putc() */
|
||||||
#if defined(__LP64__)
|
#if defined(__LP64__)
|
||||||
- char __private[152];
|
- char __private[152];
|
||||||
+ int _flags; /* flags, below; this FILE is free if 0 */
|
+ int _flags; /* flags, below; this FILE is free if 0 */
|
||||||
+ int _file; /* fileno, if Unix descriptor, else -1 */
|
+ int _file; /* fileno, if Unix descriptor, else -1 */
|
||||||
#else
|
#else
|
||||||
- char __private[84];
|
- char __private[84];
|
||||||
+ short _flags; /* flags, below; this FILE is free if 0 */
|
+ short _flags; /* flags, below; this FILE is free if 0 */
|
||||||
+ short _file; /* fileno, if Unix descriptor, else -1 */
|
+ short _file; /* fileno, if Unix descriptor, else -1 */
|
||||||
#endif
|
#endif
|
||||||
-} __attribute__((aligned(sizeof(void*))));
|
-} __attribute__((aligned(sizeof(void*))));
|
||||||
+ struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */
|
+ struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */
|
||||||
+ int _lbfsize; /* 0 or -_bf._size, for inline putc */
|
+ int _lbfsize; /* 0 or -_bf._size, for inline putc */
|
||||||
+
|
+
|
||||||
+ /* operations */
|
+ /* operations */
|
||||||
+ void *_cookie; /* cookie passed to io functions */
|
+ void *_cookie; /* cookie passed to io functions */
|
||||||
+ int (*_close)(void *);
|
+ int (*_close)(void *);
|
||||||
+ int (*_read)(void *, char *, int);
|
+ int (*_read)(void *, char *, int);
|
||||||
+ _struct_file_off_t (*_seek)(void *, _struct_file_off_t, int);
|
+ _struct_file_off_t (*_seek)(void *, _struct_file_off_t, int);
|
||||||
+ int (*_write)(void *, const char *, int);
|
+ int (*_write)(void *, const char *, int);
|
||||||
+
|
+
|
||||||
+ /* extension data, to avoid further ABI breakage */
|
+ /* extension data, to avoid further ABI breakage */
|
||||||
+ struct __sbuf _ext;
|
+ struct __sbuf _ext;
|
||||||
+ /* data for long sequences of ungetc() */
|
+ /* data for long sequences of ungetc() */
|
||||||
+ unsigned char *_up; /* saved _p when _p is doing ungetc data */
|
+ unsigned char *_up; /* saved _p when _p is doing ungetc data */
|
||||||
+ int _ur; /* saved _r when _r is counting ungetc data */
|
+ int _ur; /* saved _r when _r is counting ungetc data */
|
||||||
+
|
+
|
||||||
+ /* tricks to meet minimum requirements even when malloc() fails */
|
+ /* tricks to meet minimum requirements even when malloc() fails */
|
||||||
+ unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */
|
+ unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */
|
||||||
+ unsigned char _nbuf[1]; /* guarantee a getc() buffer */
|
+ unsigned char _nbuf[1]; /* guarantee a getc() buffer */
|
||||||
+
|
+
|
||||||
+ /* separate buffer for fgetln() when line crosses buffer boundary */
|
+ /* separate buffer for fgetln() when line crosses buffer boundary */
|
||||||
+ struct __sbuf _lb; /* buffer for fgetln() */
|
+ struct __sbuf _lb; /* buffer for fgetln() */
|
||||||
+
|
+
|
||||||
+ /* Unix stdio files get aligned to block boundaries on fseek() */
|
+ /* Unix stdio files get aligned to block boundaries on fseek() */
|
||||||
+ int _blksize; /* stat.st_blksize (may be != _bf._size) */
|
+ int _blksize; /* stat.st_blksize (may be != _bf._size) */
|
||||||
+ _struct_file_off_t _offset; /* current lseek offset */
|
+ _struct_file_off_t _offset; /* current lseek offset */
|
||||||
+};
|
+};
|
||||||
+
|
+#define __SLBF 0x0001 /* line buffered */
|
||||||
+#define __SLBF 0x0001 /* line buffered */
|
+#define __SNBF 0x0002 /* unbuffered */
|
||||||
+#define __SNBF 0x0002 /* unbuffered */
|
+#define __SRD 0x0004 /* OK to read */
|
||||||
+#define __SRD 0x0004 /* OK to read */
|
+#define __SWR 0x0008 /* OK to write */
|
||||||
+#define __SWR 0x0008 /* OK to write */
|
|
||||||
+ /* RD and WR are never simultaneously asserted */
|
+ /* RD and WR are never simultaneously asserted */
|
||||||
+#define __SRW 0x0010 /* open for reading & writing */
|
+#define __SRW 0x0010 /* open for reading & writing */
|
||||||
+#define __SEOF 0x0020 /* found EOF */
|
+#define __SEOF 0x0020 /* found EOF */
|
||||||
+#define __SERR 0x0040 /* found error */
|
+#define __SERR 0x0040 /* found error */
|
||||||
+#define __SMBF 0x0080 /* _buf is from malloc */
|
+#define __SMBF 0x0080 /* _buf is from malloc */
|
||||||
+#define __SAPP 0x0100 /* fdopen()ed in append mode */
|
+#define __SAPP 0x0100 /* fdopen()ed in append mode */
|
||||||
+#define __SSTR 0x0200 /* this is an sprintf/snprintf string */
|
+#define __SSTR 0x0200 /* this is an sprintf/snprintf string */
|
||||||
+#define __SOPT 0x0400 /* do fseek() optimization */
|
+#define __SOPT 0x0400 /* do fseek() optimization */
|
||||||
+#define __SNPT 0x0800 /* do not do fseek() optimization */
|
+#define __SNPT 0x0800 /* do not do fseek() optimization */
|
||||||
+#define __SOFF 0x1000 /* set iff _offset is in fact correct */
|
+#define __SOFF 0x1000 /* set iff _offset is in fact correct */
|
||||||
+#define __SMOD 0x2000 /* true => fgetln modified _p text */
|
+#define __SMOD 0x2000 /* true => fgetln modified _p text */
|
||||||
+#define __SALC 0x4000 /* allocate string space dynamically */
|
+#define __SALC 0x4000 /* allocate string space dynamically */
|
||||||
+#define __SIGN 0x8000 /* ignore this file in _fwalk */
|
+#define __SIGN 0x8000 /* ignore this file in _fwalk */
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
|
|
|
@ -1,27 +1,31 @@
|
||||||
diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/paths.h ./usr/include/paths.h
|
--- ./usr/include/paths.h.orig 2019-06-10 00:10:55.544212642 +0000
|
||||||
--- /home/fornwall/lib/android-ndk/sysroot/usr/include/paths.h 2017-11-09 09:57:12.000000000 +0100
|
+++ ./usr/include/paths.h 2019-06-10 00:16:51.514412646 +0000
|
||||||
+++ ./usr/include/paths.h 2017-11-15 11:51:24.456129565 +0100
|
@@ -38,16 +38,14 @@
|
||||||
@@ -34,15 +34,19 @@
|
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
|
|
||||||
-#ifndef _PATH_BSHELL
|
-#ifndef _PATH_BSHELL
|
||||||
-#define _PATH_BSHELL "/system/bin/sh"
|
/** Path to the default system shell. Historically the 'B' was to specify the Bourne shell. */
|
||||||
|
-#define _PATH_BSHELL "/system/bin/sh"
|
||||||
-#endif
|
-#endif
|
||||||
+#define _PATH_BSHELL "@TERMUX_PREFIX@/bin/sh"
|
+#define _PATH_BSHELL "@TERMUX_PREFIX@/bin/sh"
|
||||||
#define _PATH_CONSOLE "/dev/console"
|
|
||||||
-#define _PATH_DEFPATH "/sbin:/system/sbin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin"
|
|
||||||
+#define _PATH_DEFPATH "@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets"
|
|
||||||
#define _PATH_DEV "/dev/"
|
|
||||||
#define _PATH_DEVNULL "/dev/null"
|
|
||||||
#define _PATH_KLOG "/proc/kmsg"
|
|
||||||
#define _PATH_MOUNTED "/proc/mounts"
|
|
||||||
#define _PATH_TTY "/dev/tty"
|
|
||||||
|
|
||||||
+#define _PATH_STDPATH _PATH_DEFPATH
|
/** Path to the system console. */
|
||||||
+#define _PATH_TMP "@TERMUX_PREFIX@/tmp/"
|
#define _PATH_CONSOLE "/dev/console"
|
||||||
+#define _PATH_VARDB "@TERMUX_PREFIX@/var/db/"
|
|
||||||
+#define _PATH_VARRUN "@TERMUX_PREFIX@/var/run/"
|
/** Default shell search path. */
|
||||||
+#define _PATH_VARTMP "@TERMUX_PREFIX@/var/tmp/"
|
-#define _PATH_DEFPATH "/sbin:/system/sbin:/product/bin:/apex/com.android.runtime/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin"
|
||||||
|
+#define _PATH_DEFPATH "@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets"
|
||||||
|
|
||||||
|
/** Path to the directory containing device files. */
|
||||||
|
#define _PATH_DEV "/dev/"
|
||||||
|
@@ -63,3 +61,9 @@
|
||||||
|
|
||||||
|
/** Path to the calling process' tty. */
|
||||||
|
#define _PATH_TTY "/dev/tty"
|
||||||
|
+#define _PATH_STDPATH _PATH_DEFPATH
|
||||||
|
+#define _PATH_TMP "@TERMUX_PREFIX@/tmp/"
|
||||||
|
+#define _PATH_VARDB "@TERMUX_PREFIX@/var/db/"
|
||||||
|
+#define _PATH_VARRUN "@TERMUX_PREFIX@/var/run/"
|
||||||
|
+#define _PATH_VARTMP "@TERMUX_PREFIX@/var/tmp/"
|
||||||
+
|
+
|
||||||
#endif /* !_PATHS_H_ */
|
|
||||||
|
|
|
@ -80,48 +80,51 @@ termux_step_setup_toolchain() {
|
||||||
elif [ "$TERMUX_ARCH" = "i686" ]; then
|
elif [ "$TERMUX_ARCH" = "i686" ]; then
|
||||||
_NDK_ARCHNAME=x86
|
_NDK_ARCHNAME=x86
|
||||||
fi
|
fi
|
||||||
|
cp $NDK/toolchains/llvm/prebuilt/linux-x86_64 $_TERMUX_TOOLCHAIN_TMPDIR -r
|
||||||
"$NDK/build/tools/make_standalone_toolchain.py" \
|
|
||||||
--api "$TERMUX_PKG_API_LEVEL" \
|
|
||||||
--arch $_NDK_ARCHNAME \
|
|
||||||
--stl=libc++ \
|
|
||||||
--install-dir $_TERMUX_TOOLCHAIN_TMPDIR
|
|
||||||
|
|
||||||
# Remove android-support header wrapping not needed on android-21:
|
# Remove android-support header wrapping not needed on android-21:
|
||||||
rm -Rf $_TERMUX_TOOLCHAIN_TMPDIR/sysroot/usr/local
|
rm -Rf $_TERMUX_TOOLCHAIN_TMPDIR/sysroot/usr/local
|
||||||
|
|
||||||
if [ "$TERMUX_ARCH" = "aarch64" ]; then
|
# Use gold by default to work around https://github.com/android-ndk/ndk/issues/148
|
||||||
# Use gold by default to work around https://github.com/android-ndk/ndk/issues/148
|
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/aarch64-linux-android-ld.gold \
|
||||||
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/aarch64-linux-android-ld.gold \
|
$_TERMUX_TOOLCHAIN_TMPDIR/bin/aarch64-linux-android-ld
|
||||||
$_TERMUX_TOOLCHAIN_TMPDIR/bin/aarch64-linux-android-ld
|
cp $_TERMUX_TOOLCHAIN_TMPDIR/aarch64-linux-android/bin/ld.gold \
|
||||||
cp $_TERMUX_TOOLCHAIN_TMPDIR/aarch64-linux-android/bin/ld.gold \
|
$_TERMUX_TOOLCHAIN_TMPDIR/aarch64-linux-android/bin/ld
|
||||||
$_TERMUX_TOOLCHAIN_TMPDIR/aarch64-linux-android/bin/ld
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$TERMUX_ARCH" = "arm" ]; then
|
|
||||||
# Linker wrapper script to add '--exclude-libs libgcc.a', see
|
# Linker wrapper script to add '--exclude-libs libgcc.a', see
|
||||||
# https://github.com/android-ndk/ndk/issues/379
|
# https://github.com/android-ndk/ndk/issues/379
|
||||||
# https://android-review.googlesource.com/#/c/389852/
|
# https://android-review.googlesource.com/#/c/389852/
|
||||||
local linker
|
local linker
|
||||||
for linker in ld ld.bfd ld.gold; do
|
for linker in ld ld.bfd ld.gold; do
|
||||||
local wrap_linker=$_TERMUX_TOOLCHAIN_TMPDIR/$TERMUX_HOST_PLATFORM/bin/$linker
|
local wrap_linker=$_TERMUX_TOOLCHAIN_TMPDIR/arm-linux-androideabi/bin/$linker
|
||||||
local real_linker=$_TERMUX_TOOLCHAIN_TMPDIR/$TERMUX_HOST_PLATFORM/bin/$linker.real
|
local real_linker=$_TERMUX_TOOLCHAIN_TMPDIR/arm-linux-androideabi/bin/$linker.real
|
||||||
cp $wrap_linker $real_linker
|
cp $wrap_linker $real_linker
|
||||||
echo '#!/bin/bash' > $wrap_linker
|
echo '#!/bin/bash' > $wrap_linker
|
||||||
echo -n '$(dirname $0)/' >> $wrap_linker
|
echo -n '$(dirname $0)/' >> $wrap_linker
|
||||||
echo -n $linker.real >> $wrap_linker
|
echo -n $linker.real >> $wrap_linker
|
||||||
echo ' --exclude-libs libunwind.a --exclude-libs libgcc_real.a "$@"' >> $wrap_linker
|
echo ' --exclude-libs libunwind.a --exclude-libs libgcc_real.a "$@"' >> $wrap_linker
|
||||||
done
|
done
|
||||||
fi
|
for HOST_PLAT in aarch64-linux-android armv7a-linux-androideabi i686-linux-android x86_64-linux-android; do
|
||||||
|
|
||||||
# Setup the cpp preprocessor:
|
# Setup the cpp preprocessor:
|
||||||
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$TERMUX_HOST_PLATFORM-clang \
|
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT$TERMUX_PKG_API_LEVEL-clang \
|
||||||
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$TERMUX_HOST_PLATFORM-cpp
|
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-clang
|
||||||
sed -i 's/clang80/clang80 -E/' \
|
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT$TERMUX_PKG_API_LEVEL-clang++ \
|
||||||
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$TERMUX_HOST_PLATFORM-cpp
|
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-clang++
|
||||||
|
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT$TERMUX_PKG_API_LEVEL-clang \
|
||||||
|
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-cpp
|
||||||
|
sed -i 's/clang/clang -E/' \
|
||||||
|
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-cpp
|
||||||
|
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-clang \
|
||||||
|
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-gcc
|
||||||
|
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-clang++ \
|
||||||
|
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-gcc
|
||||||
|
done
|
||||||
|
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/armv7a-linux-androideabi$TERMUX_PKG_API_LEVEL-clang \
|
||||||
|
$_TERMUX_TOOLCHAIN_TMPDIR/bin/arm-linux-androideabi-clang
|
||||||
|
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/armv7a-linux-androideabi$TERMUX_PKG_API_LEVEL-clang++ \
|
||||||
|
$_TERMUX_TOOLCHAIN_TMPDIR/bin/arm-linux-androideabi-clang++
|
||||||
cd $_TERMUX_TOOLCHAIN_TMPDIR/sysroot
|
cd $_TERMUX_TOOLCHAIN_TMPDIR/sysroot
|
||||||
|
|
||||||
for f in $TERMUX_SCRIPTDIR/ndk-patches/*.patch; do
|
for f in $TERMUX_SCRIPTDIR/ndk-patches/*.patch; do
|
||||||
sed "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" "$f" | \
|
sed "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" "$f" | \
|
||||||
sed "s%\@TERMUX_HOME\@%${TERMUX_ANDROID_HOME}%g" | \
|
sed "s%\@TERMUX_HOME\@%${TERMUX_ANDROID_HOME}%g" | \
|
||||||
|
|
|
@ -2,10 +2,10 @@ termux_step_start_build() {
|
||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
source "$TERMUX_PKG_BUILDER_SCRIPT"
|
source "$TERMUX_PKG_BUILDER_SCRIPT"
|
||||||
|
|
||||||
TERMUX_STANDALONE_TOOLCHAIN="$TERMUX_COMMON_CACHEDIR/${TERMUX_NDK_VERSION}-${TERMUX_ARCH}-${TERMUX_PKG_API_LEVEL}"
|
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
|
# 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+="-v5"
|
TERMUX_STANDALONE_TOOLCHAIN+="-v1"
|
||||||
|
|
||||||
if [ -n "${TERMUX_PKG_BLACKLISTED_ARCHES:=""}" ] && [ "$TERMUX_PKG_BLACKLISTED_ARCHES" != "${TERMUX_PKG_BLACKLISTED_ARCHES/$TERMUX_ARCH/}" ]; then
|
if [ -n "${TERMUX_PKG_BLACKLISTED_ARCHES:=""}" ] && [ "$TERMUX_PKG_BLACKLISTED_ARCHES" != "${TERMUX_PKG_BLACKLISTED_ARCHES/$TERMUX_ARCH/}" ]; then
|
||||||
echo "Skipping building $TERMUX_PKG_NAME for arch $TERMUX_ARCH"
|
echo "Skipping building $TERMUX_PKG_NAME for arch $TERMUX_ARCH"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
TERMUX_ANDROID_BUILD_TOOLS_VERSION=28.0.3
|
TERMUX_ANDROID_BUILD_TOOLS_VERSION=28.0.3
|
||||||
TERMUX_NDK_VERSION_NUM=19
|
TERMUX_NDK_VERSION_NUM=20
|
||||||
TERMUX_NDK_REVISION=b
|
TERMUX_NDK_REVISION=""
|
||||||
TERMUX_NDK_VERSION=$TERMUX_NDK_VERSION_NUM$TERMUX_NDK_REVISION
|
TERMUX_NDK_VERSION=$TERMUX_NDK_VERSION_NUM$TERMUX_NDK_REVISION
|
||||||
|
|
||||||
test -f "$HOME/.termuxrc" && . "$HOME/.termuxrc"
|
test -f "$HOME/.termuxrc" && . "$HOME/.termuxrc"
|
||||||
|
|
Loading…
Reference in New Issue