Update from NDK r14 to r15

The docker image has been updated, use
	./scripts/update-docker.sh
to update.

Note that we are still using the old deprecated non-unified headers
- updating to that is the next step.
This commit is contained in:
Fredrik Fornwall 2017-06-11 22:55:04 +02:00
parent 0bee5183c8
commit 49dd98a346
7 changed files with 11 additions and 127 deletions

View File

@ -186,7 +186,7 @@ termux_step_setup_variables() {
: "${TERMUX_DEBUG:=""}"
: "${TERMUX_API_LEVEL:="21"}"
: "${TERMUX_ANDROID_BUILD_TOOLS_VERSION:="25.0.3"}"
: "${TERMUX_NDK_VERSION:="14"}"
: "${TERMUX_NDK_VERSION:="15"}"
if [ "x86_64" = "$TERMUX_ARCH" ] || [ "aarch64" = "$TERMUX_ARCH" ]; then
TERMUX_ARCH_BITS=64
@ -528,6 +528,7 @@ termux_step_setup_toolchain() {
fi
"$NDK/build/tools/make_standalone_toolchain.py" \
--deprecated-headers \
--api "$TERMUX_API_LEVEL" \
--arch $_NDK_ARCHNAME \
--install-dir $_TERMUX_TOOLCHAIN_TMPDIR
@ -541,7 +542,7 @@ termux_step_setup_toolchain() {
termux_error_exit "No toolchain file to override: $FILE_TO_REPLACE"
fi
cp "$TERMUX_SCRIPTDIR/scripts/clang-pie-wrapper" $FILE_TO_REPLACE
sed -i "s/COMPILER/clang38$plusplus/" $FILE_TO_REPLACE
sed -i "s/COMPILER/clang50$plusplus/" $FILE_TO_REPLACE
sed -i "s/CLANG_TARGET/$CLANG_TARGET/" $FILE_TO_REPLACE
done
done

View File

@ -1,27 +1,15 @@
TERMUX_PKG_HOMEPAGE=https://developer.android.com/tools/sdk/ndk/index.html
TERMUX_PKG_HOMEPAGE=https://github.com/termux/libandroid-support
TERMUX_PKG_DESCRIPTION="Library extending the Android C library (Bionic) for additional multibyte, locale and math support"
TERMUX_PKG_VERSION=${TERMUX_NDK_VERSION}
TERMUX_PKG_VERSION=15
TERMUX_PKG_SRCURL=https://github.com/termux/libandroid-support/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=73f7543c6005d376edcaf915ac22f53a9f0a2d6c87fe7dde5f890d26c8d49ebc
TERMUX_PKG_FOLDERNAME=libandroid-support-$TERMUX_PKG_VERSION
TERMUX_PKG_BUILD_IN_SRC=yes
TERMUX_PKG_ESSENTIAL=yes
termux_step_post_extract_package () {
mkdir -p src/musl-locale/ src/musl-multibyte/ include/ src/musl-ctype/
cp $NDK/sources/android/support/src/musl-multibyte/{mblen.c,mbsrtowcs.c,mbsnrtowcs.c,libc.h,internal.h,internal.c} src/musl-multibyte/
cp $NDK/sources/android/support/src/musl-locale/{catclose.c,catgets.c,catopen.c} src/musl-locale/
cp $NDK/sources/android/support/src/musl-locale/{langinfo.c,intl.c,iconv.c,strfmon.c} src/musl-locale/
cp $NDK/sources/android/support/src/musl-ctype/* src/musl-ctype/
cp $NDK/sources/android/support/include/* include/
cp $NDK/sources/android/support/src/musl-locale/{libc.h,codepages.h,legacychars.h,jis0208.h,gb18030.h,big5.h,hkscs.h,ksc.h} include/
# Use up-to-date (Unicode 9) wcwidth:
cp $TERMUX_PKG_BUILDER_DIR/wcwidth.c $NDK/sources/android/support/src/musl-ctype/wcwidth.c
}
termux_step_make_install () {
_C_FILES="src/musl-*/*.c"
# Link against libm to avoid linkers having to do it
$CC $CFLAGS -std=c99 -DNULL=0 $CPPFLAGS $LDFLAGS -lm \
$CC $CFLAGS -std=c99 -DNULL=0 $CPPFLAGS $LDFLAGS \
-Iinclude -Isrc/locale \
$_C_FILES \
-shared -fpic \

View File

@ -1,24 +0,0 @@
diff -u -r /home/fornwall/lib/android-ndk/sources/android/support/include/iconv.h ./include/iconv.h
--- /home/fornwall/lib/android-ndk/sources/android/support/include/iconv.h 2016-03-03 16:54:04.000000000 -0500
+++ ./include/iconv.h 2016-05-25 16:15:29.543192668 -0400
@@ -28,8 +28,6 @@
#ifndef NDK_ANDROID_SUPPORT_ICONV_H
#define NDK_ANDROID_SUPPORT_ICONV_H
-#if !defined(__LP64__)
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -43,9 +41,7 @@
int iconv_close(iconv_t);
#ifdef __cplusplus
-} // extern "C"
+}
#endif
-#endif // !__LP64__
-
-#endif // NDK_ANDROID_SUPPORT_ICONV_H
+#endif

View File

@ -1,11 +0,0 @@
diff -u -r /home/fornwall/lib/android-ndk/sources/android/support/include/wchar.h ./include/wchar.h
--- /home/fornwall/lib/android-ndk/sources/android/support/include/wchar.h 2014-08-03 23:06:22.000000000 -0400
+++ ./include/wchar.h 2015-07-13 03:18:31.440649551 -0400
@@ -119,6 +119,7 @@
wchar_t *wcstok (wchar_t *__restrict__, const wchar_t *__restrict__, wchar_t **__restrict__);
size_t wcslen (const wchar_t *);
+size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t siz);
wchar_t *wcsstr (const wchar_t *__restrict__, const wchar_t *__restrict__);
wchar_t *wcswcs (const wchar_t *, const wchar_t *);

View File

@ -1,27 +0,0 @@
Include <xlocale.h> from langinfo.h so that locale_t gets defined.
Include <locale.h> from langinfo.h so that LC_ALL gets defined.
diff -u -r /home/fornwall/lib/android-ndk/sources/android/support/include/langinfo.h ./include/langinfo.h
--- /home/fornwall/lib/android-ndk/sources/android/support/include/langinfo.h 2016-03-03 16:54:04.000000000 -0500
+++ ./include/langinfo.h 2016-03-12 17:23:01.187197445 -0500
@@ -31,6 +31,8 @@
// __LP64__
#include <nl_types.h>
+#include <xlocale.h>
+#include <locale.h>
#define _NL_ITEM(category,index) (((category) << 10) | (index))
@@ -111,10 +112,8 @@
extern "C" {
#endif
-#if !defined(__LP64__)
char *nl_langinfo(nl_item);
char *nl_langinfo_l(nl_item, locale_t);
-#endif // !__LP64__
#ifdef __cplusplus
} // extern "C"

View File

@ -1,43 +0,0 @@
diff -N -u -r /home/fornwall/lib/android-ndk/sources/android/support/include/libintl.h ./include/libintl.h
--- /home/fornwall/lib/android-ndk/sources/android/support/include/libintl.h 1969-12-31 19:00:00.000000000 -0500
+++ ./include/libintl.h 2014-11-27 10:50:18.306215538 -0500
@@ -0,0 +1,39 @@
+#ifndef NDK_ANDROID_SUPPORT_LIBINTL_H
+#define NDK_ANDROID_SUPPORT_LIBINTL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Look up MSGID in the current default message catalog for the current LC_MESSAGES locale. If not found, returns MSGID itself (the default text). */
+char *gettext (const char *__msgid);
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current LC_MESSAGES locale. */
+char *dgettext (const char *__domainname, const char *__msgid);
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */
+char *dcgettext (const char *__domainname, const char *__msgid, int __category);
+
+/* Similar to `gettext' but select the plural form corresponding to the number N. */
+char *ngettext (const char *__msgid1, const char *__msgid2, unsigned long int __n);
+
+/* Similar to `dgettext' but select the plural form corresponding to the number N. */
+char *dngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n);
+
+/* Similar to `dcgettext' but select the plural form corresponding to the number N. */
+char *dcngettext (const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category);
+
+/* Set the current default message catalog to DOMAINNAME. If DOMAINNAME is null, return the current default. If DOMAINNAME is "", reset to the default of "messages". */
+char *textdomain (const char *__domainname);
+
+/* Specify that the DOMAINNAME message catalog will be found in DIRNAME rather than in the system locale data base. */
+char *bindtextdomain (const char *__domainname, const char *__dirname);
+
+/* Specify the character encoding in which the messages from the DOMAINNAME message catalog will be returned. */
+char *bind_textdomain_codeset (const char *__domainname, const char *__codeset);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // NDK_ANDROID_SUPPORT_LIBINTL_H

View File

@ -25,7 +25,7 @@ if [ ! -d $NDK ]; then
mkdir -p $NDK
cd $NDK/..
rm -Rf `basename $NDK`
NDK_VERSION=r14
NDK_VERSION=r15
curl --fail --retry 3 -o ndk.zip \
http://dl.google.com/android/repository/android-ndk-${NDK_VERSION}-`uname`-x86_64.zip
@ -35,6 +35,6 @@ if [ ! -d $NDK ]; then
rm ndk.zip
fi
mkdir $ANDROID_HOME/licenses
mkdir -p $ANDROID_HOME/licenses
echo -e -n "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > $ANDROID_HOME/licenses/android-sdk-license
$ANDROID_HOME/tools/bin/sdkmanager "build-tools;25.0.3" "platforms;android-25"