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
|
||||
--- /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 2017-06-26 13:35:19.040117023 +0200
|
||||
@@ -33,13 +33,80 @@
|
||||
--- ./usr/include/bits/struct_file.h.orig 2019-06-10 09:40:35.872857650 +1000
|
||||
+++ ./usr/include/bits/struct_file.h 2019-06-10 09:55:10.890308649 +1000
|
||||
@@ -31,14 +31,79 @@
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
+#if defined(__LP64__)
|
||||
+struct __sbuf {
|
||||
+ unsigned char* _base;
|
||||
@ -16,13 +15,14 @@ diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/bits/struct_file.h
|
||||
+ int _size;
|
||||
+};
|
||||
+#endif
|
||||
+
|
||||
+#if defined(__LP64__)
|
||||
+typedef int64_t _struct_file_off_t;
|
||||
+#else
|
||||
+typedef __kernel_off_t _struct_file_off_t;
|
||||
+#endif
|
||||
+
|
||||
|
||||
/** The opaque structure implementing `FILE`. Do not make any assumptions about its content. */
|
||||
struct __sFILE {
|
||||
+ unsigned char *_p; /* current position in (some) buffer */
|
||||
+ int _r; /* read space left for getc() */
|
||||
@ -64,7 +64,6 @@ diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/bits/struct_file.h
|
||||
+ int _blksize; /* stat.st_blksize (may be != _bf._size) */
|
||||
+ _struct_file_off_t _offset; /* current lseek offset */
|
||||
+};
|
||||
+
|
||||
+#define __SLBF 0x0001 /* line buffered */
|
||||
+#define __SNBF 0x0002 /* unbuffered */
|
||||
+#define __SRD 0x0004 /* OK to read */
|
||||
@ -84,4 +83,3 @@ diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/bits/struct_file.h
|
||||
+#define __SIGN 0x8000 /* ignore this file in _fwalk */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
@ -1,27 +1,31 @@
|
||||
diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/paths.h ./usr/include/paths.h
|
||||
--- /home/fornwall/lib/android-ndk/sysroot/usr/include/paths.h 2017-11-09 09:57:12.000000000 +0100
|
||||
+++ ./usr/include/paths.h 2017-11-15 11:51:24.456129565 +0100
|
||||
@@ -34,15 +34,19 @@
|
||||
--- ./usr/include/paths.h.orig 2019-06-10 00:10:55.544212642 +0000
|
||||
+++ ./usr/include/paths.h 2019-06-10 00:16:51.514412646 +0000
|
||||
@@ -38,16 +38,14 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
-#ifndef _PATH_BSHELL
|
||||
/** Path to the default system shell. Historically the 'B' was to specify the Bourne shell. */
|
||||
-#define _PATH_BSHELL "/system/bin/sh"
|
||||
-#endif
|
||||
+#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"
|
||||
|
||||
/** Path to the system console. */
|
||||
#define _PATH_CONSOLE "/dev/console"
|
||||
|
||||
/** Default shell search path. */
|
||||
-#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
|
||||
_NDK_ARCHNAME=x86
|
||||
fi
|
||||
|
||||
"$NDK/build/tools/make_standalone_toolchain.py" \
|
||||
--api "$TERMUX_PKG_API_LEVEL" \
|
||||
--arch $_NDK_ARCHNAME \
|
||||
--stl=libc++ \
|
||||
--install-dir $_TERMUX_TOOLCHAIN_TMPDIR
|
||||
cp $NDK/toolchains/llvm/prebuilt/linux-x86_64 $_TERMUX_TOOLCHAIN_TMPDIR -r
|
||||
|
||||
# Remove android-support header wrapping not needed on android-21:
|
||||
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
|
||||
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/aarch64-linux-android-ld.gold \
|
||||
$_TERMUX_TOOLCHAIN_TMPDIR/bin/aarch64-linux-android-ld
|
||||
cp $_TERMUX_TOOLCHAIN_TMPDIR/aarch64-linux-android/bin/ld.gold \
|
||||
$_TERMUX_TOOLCHAIN_TMPDIR/aarch64-linux-android/bin/ld
|
||||
fi
|
||||
|
||||
if [ "$TERMUX_ARCH" = "arm" ]; then
|
||||
# Linker wrapper script to add '--exclude-libs libgcc.a', see
|
||||
# https://github.com/android-ndk/ndk/issues/379
|
||||
# https://android-review.googlesource.com/#/c/389852/
|
||||
local linker
|
||||
for linker in ld ld.bfd ld.gold; do
|
||||
local wrap_linker=$_TERMUX_TOOLCHAIN_TMPDIR/$TERMUX_HOST_PLATFORM/bin/$linker
|
||||
local real_linker=$_TERMUX_TOOLCHAIN_TMPDIR/$TERMUX_HOST_PLATFORM/bin/$linker.real
|
||||
local wrap_linker=$_TERMUX_TOOLCHAIN_TMPDIR/arm-linux-androideabi/bin/$linker
|
||||
local real_linker=$_TERMUX_TOOLCHAIN_TMPDIR/arm-linux-androideabi/bin/$linker.real
|
||||
cp $wrap_linker $real_linker
|
||||
echo '#!/bin/bash' > $wrap_linker
|
||||
echo -n '$(dirname $0)/' >> $wrap_linker
|
||||
echo -n $linker.real >> $wrap_linker
|
||||
echo ' --exclude-libs libunwind.a --exclude-libs libgcc_real.a "$@"' >> $wrap_linker
|
||||
done
|
||||
fi
|
||||
for HOST_PLAT in aarch64-linux-android armv7a-linux-androideabi i686-linux-android x86_64-linux-android; do
|
||||
|
||||
# Setup the cpp preprocessor:
|
||||
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$TERMUX_HOST_PLATFORM-clang \
|
||||
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$TERMUX_HOST_PLATFORM-cpp
|
||||
sed -i 's/clang80/clang80 -E/' \
|
||||
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$TERMUX_HOST_PLATFORM-cpp
|
||||
|
||||
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT$TERMUX_PKG_API_LEVEL-clang \
|
||||
$_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-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
|
||||
|
||||
for f in $TERMUX_SCRIPTDIR/ndk-patches/*.patch; do
|
||||
sed "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" "$f" | \
|
||||
sed "s%\@TERMUX_HOME\@%${TERMUX_ANDROID_HOME}%g" | \
|
||||
|
@ -2,10 +2,10 @@ termux_step_start_build() {
|
||||
# shellcheck source=/dev/null
|
||||
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
|
||||
# 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
|
||||
echo "Skipping building $TERMUX_PKG_NAME for arch $TERMUX_ARCH"
|
||||
|
@ -1,6 +1,6 @@
|
||||
TERMUX_ANDROID_BUILD_TOOLS_VERSION=28.0.3
|
||||
TERMUX_NDK_VERSION_NUM=19
|
||||
TERMUX_NDK_REVISION=b
|
||||
TERMUX_NDK_VERSION_NUM=20
|
||||
TERMUX_NDK_REVISION=""
|
||||
TERMUX_NDK_VERSION=$TERMUX_NDK_VERSION_NUM$TERMUX_NDK_REVISION
|
||||
|
||||
test -f "$HOME/.termuxrc" && . "$HOME/.termuxrc"
|
||||
|
Loading…
Reference in New Issue
Block a user