From 94df5b671bae1760ddc0c162e72541da70bd03f0 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Sat, 10 May 2025 10:25:50 +0200 Subject: [PATCH] scripts(toolchain): Update NDK to r28c --- build-package.sh | 4 +-- ndk-patches/27c/linux-fcntl.h.patch | 11 ------ ndk-patches/27c/stdlib.h.patch | 22 ------------ .../{27c => 28c}/bits-struct_file.h.patch | 0 .../c++-v1-module.modulemap.patch | 0 .../{27c => 28c}/c++-v1-stdlib.h.patch | 0 ndk-patches/{27c => 28c}/dirent.h.patch | 0 ndk-patches/28c/fcntl.h.patch | 18 ++++++++++ ndk-patches/{27c => 28c}/grp.h.patch | 13 +++---- ndk-patches/28c/linux-fcntl.h.patch | 12 +++++++ ndk-patches/{27c => 28c}/paths.h.patch | 12 +++---- ndk-patches/{27c => 28c}/pwd.h.patch | 11 +++--- .../{27c => 28c}/redefine-TCSAFLUSH.patch | 0 ndk-patches/{27c => 28c}/semaphore.h.patch | 0 ndk-patches/{27c => 28c}/stdio.h.patch | 33 +++++++++--------- ndk-patches/28c/stdlib.h.patch | 34 +++++++++++++++++++ ndk-patches/{27c => 28c}/sys-cdefs.h.patch | 0 ndk-patches/{27c => 28c}/sys-time.h.patch | 13 +++---- ndk-patches/{27c => 28c}/syslog.patch | 0 ndk-patches/{27c => 28c}/time.h.patch | 0 ndk-patches/{27c => 28c}/unistd.h.patch | 0 ndk-patches/{27c => 28c}/utmp.h.patch | 0 packages/libandroid-stub/build.sh | 3 +- packages/libc++/build.sh | 2 +- packages/ndk-multilib/build.sh | 2 +- packages/ndk-sysroot/build.sh | 6 ++-- packages/vulkan-loader-android/build.sh | 2 +- scripts/build/termux_step_setup_toolchain.sh | 4 +-- ...n_27c.sh => termux_setup_toolchain_28c.sh} | 2 +- scripts/properties.sh | 2 +- scripts/setup-android-sdk.sh | 4 +-- 31 files changed, 121 insertions(+), 89 deletions(-) delete mode 100644 ndk-patches/27c/linux-fcntl.h.patch delete mode 100644 ndk-patches/27c/stdlib.h.patch rename ndk-patches/{27c => 28c}/bits-struct_file.h.patch (100%) rename ndk-patches/{27c => 28c}/c++-v1-module.modulemap.patch (100%) rename ndk-patches/{27c => 28c}/c++-v1-stdlib.h.patch (100%) rename ndk-patches/{27c => 28c}/dirent.h.patch (100%) create mode 100644 ndk-patches/28c/fcntl.h.patch rename ndk-patches/{27c => 28c}/grp.h.patch (68%) create mode 100644 ndk-patches/28c/linux-fcntl.h.patch rename ndk-patches/{27c => 28c}/paths.h.patch (70%) rename ndk-patches/{27c => 28c}/pwd.h.patch (83%) rename ndk-patches/{27c => 28c}/redefine-TCSAFLUSH.patch (100%) rename ndk-patches/{27c => 28c}/semaphore.h.patch (100%) rename ndk-patches/{27c => 28c}/stdio.h.patch (70%) create mode 100644 ndk-patches/28c/stdlib.h.patch rename ndk-patches/{27c => 28c}/sys-cdefs.h.patch (100%) rename ndk-patches/{27c => 28c}/sys-time.h.patch (59%) rename ndk-patches/{27c => 28c}/syslog.patch (100%) rename ndk-patches/{27c => 28c}/time.h.patch (100%) rename ndk-patches/{27c => 28c}/unistd.h.patch (100%) rename ndk-patches/{27c => 28c}/utmp.h.patch (100%) rename scripts/build/toolchain/{termux_setup_toolchain_27c.sh => termux_setup_toolchain_28c.sh} (99%) diff --git a/build-package.sh b/build-package.sh index e82ae641bac98a..199811b1864d07 100755 --- a/build-package.sh +++ b/build-package.sh @@ -261,8 +261,8 @@ source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_handle_host_build.sh" source "$TERMUX_SCRIPTDIR/scripts/build/termux_step_host_build.sh" # Setup a standalone Android NDK toolchain. Called from termux_step_setup_toolchain. -# shellcheck source=scripts/build/toolchain/termux_setup_toolchain_27c.sh -source "$TERMUX_SCRIPTDIR/scripts/build/toolchain/termux_setup_toolchain_27c.sh" +# shellcheck source=scripts/build/toolchain/termux_setup_toolchain_28c.sh +source "$TERMUX_SCRIPTDIR/scripts/build/toolchain/termux_setup_toolchain_28c.sh" # Setup a standalone Android NDK 23c toolchain. Called from termux_step_setup_toolchain. # shellcheck source=scripts/build/toolchain/termux_setup_toolchain_23c.sh diff --git a/ndk-patches/27c/linux-fcntl.h.patch b/ndk-patches/27c/linux-fcntl.h.patch deleted file mode 100644 index 727c39832863b5..00000000000000 --- a/ndk-patches/27c/linux-fcntl.h.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ./usr/include/linux/fcntl.h -+++ ./usr/include/linux/fcntl.h -@@ -54,7 +54,7 @@ - #define DN_MULTISHOT 0x80000000 - #define AT_FDCWD - 100 - #define AT_SYMLINK_NOFOLLOW 0x100 --#define AT_EACCESS 0x200 -+#define AT_EACCESS 0 - #define AT_REMOVEDIR 0x200 - #define AT_SYMLINK_FOLLOW 0x400 - #define AT_NO_AUTOMOUNT 0x800 diff --git a/ndk-patches/27c/stdlib.h.patch b/ndk-patches/27c/stdlib.h.patch deleted file mode 100644 index 596de10e3a405f..00000000000000 --- a/ndk-patches/27c/stdlib.h.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- ./usr/include/stdlib.h.orig 2021-08-16 11:50:47.432239182 +0200 -+++ ./usr/include/stdlib.h 2021-08-16 11:51:31.102222894 +0200 -@@ -33,6 +33,9 @@ - #include - #include - #include -+#if !defined(__swift__) -+#include -+#endif - #include - #include - -@@ -207,8 +207,7 @@ - - size_t wcstombs(char* _Nullable __dst, const wchar_t* _Nullable __src, size_t __n); - --size_t __ctype_get_mb_cur_max(void); --#define MB_CUR_MAX __ctype_get_mb_cur_max() -+#define MB_CUR_MAX 4 - - #if defined(__BIONIC_INCLUDE_FORTIFY_HEADERS) - #include diff --git a/ndk-patches/27c/bits-struct_file.h.patch b/ndk-patches/28c/bits-struct_file.h.patch similarity index 100% rename from ndk-patches/27c/bits-struct_file.h.patch rename to ndk-patches/28c/bits-struct_file.h.patch diff --git a/ndk-patches/27c/c++-v1-module.modulemap.patch b/ndk-patches/28c/c++-v1-module.modulemap.patch similarity index 100% rename from ndk-patches/27c/c++-v1-module.modulemap.patch rename to ndk-patches/28c/c++-v1-module.modulemap.patch diff --git a/ndk-patches/27c/c++-v1-stdlib.h.patch b/ndk-patches/28c/c++-v1-stdlib.h.patch similarity index 100% rename from ndk-patches/27c/c++-v1-stdlib.h.patch rename to ndk-patches/28c/c++-v1-stdlib.h.patch diff --git a/ndk-patches/27c/dirent.h.patch b/ndk-patches/28c/dirent.h.patch similarity index 100% rename from ndk-patches/27c/dirent.h.patch rename to ndk-patches/28c/dirent.h.patch diff --git a/ndk-patches/28c/fcntl.h.patch b/ndk-patches/28c/fcntl.h.patch new file mode 100644 index 00000000000000..e28791fbbbe479 --- /dev/null +++ b/ndk-patches/28c/fcntl.h.patch @@ -0,0 +1,18 @@ +diff -u -r /home/builder/lib/android-ndk-r28b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/fcntl.h ./usr/include/fcntl.h +--- /home/builder/lib/android-ndk-r28b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/fcntl.h 2024-11-14 00:52:25.000000000 +0000 ++++ ./usr/include/fcntl.h 2025-05-10 08:31:55.666234328 +0000 +@@ -93,12 +93,14 @@ + /** Flag for splice(). */ + #define SPLICE_F_GIFT 8 + ++#if __ANDROID_API__ >= 26 + /** Flag for sync_file_range(). */ + #define SYNC_FILE_RANGE_WAIT_BEFORE 1 + /** Flag for sync_file_range(). */ + #define SYNC_FILE_RANGE_WRITE 2 + /** Flag for sync_file_range(). */ + #define SYNC_FILE_RANGE_WAIT_AFTER 4 ++#endif + + /** + * [creat(2)](https://man7.org/linux/man-pages/man2/creat.2.html) diff --git a/ndk-patches/27c/grp.h.patch b/ndk-patches/28c/grp.h.patch similarity index 68% rename from ndk-patches/27c/grp.h.patch rename to ndk-patches/28c/grp.h.patch index 5afe4fa7258989..7f35cbe8593ae2 100644 --- a/ndk-patches/27c/grp.h.patch +++ b/ndk-patches/28c/grp.h.patch @@ -1,23 +1,24 @@ ---- ./usr/include/grp.h.orig -+++ ./usr/include/grp.h +diff -u -r /home/builder/lib/android-ndk-r28b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/grp.h ./usr/include/grp.h +--- /home/builder/lib/android-ndk-r28b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/grp.h 2024-11-14 00:52:25.000000000 +0000 ++++ ./usr/include/grp.h 2025-05-09 18:38:52.409001807 +0000 @@ -50,21 +50,15 @@ struct group* _Nullable getgrgid(gid_t __gid); struct group* _Nullable getgrnam(const char* _Nonnull __name); -/* Note: Android has thousands and thousands of ids to iterate through. */ - --#if __ANDROID_API__ >= 26 +-#if __BIONIC_AVAILABILITY_GUARD(26) -struct group* _Nullable getgrent(void) __INTRODUCED_IN(26); - -void setgrent(void) __INTRODUCED_IN(26); -void endgrent(void) __INTRODUCED_IN(26); --#endif /* __ANDROID_API__ >= 26 */ +-#endif /* __BIONIC_AVAILABILITY_GUARD(26) */ - - - #if __ANDROID_API__ >= 24 + #if __BIONIC_AVAILABILITY_GUARD(24) int getgrgid_r(gid_t __gid, struct group* __BIONIC_COMPLICATED_NULLNESS __group, char* _Nonnull __buf, size_t __n, struct group* _Nullable * _Nonnull __result) __INTRODUCED_IN(24); int getgrnam_r(const char* _Nonnull __name, struct group* __BIONIC_COMPLICATED_NULLNESS __group, char* _Nonnull __buf, size_t __n, struct group* _Nullable *_Nonnull __result) __INTRODUCED_IN(24); - #endif /* __ANDROID_API__ >= 24 */ + #endif /* __BIONIC_AVAILABILITY_GUARD(24) */ +static struct group* _Nullable getgrent(void) { return 0; } +static void setgrent(void) {} diff --git a/ndk-patches/28c/linux-fcntl.h.patch b/ndk-patches/28c/linux-fcntl.h.patch new file mode 100644 index 00000000000000..2e392aecf395db --- /dev/null +++ b/ndk-patches/28c/linux-fcntl.h.patch @@ -0,0 +1,12 @@ +diff -u -r /home/builder/lib/android-ndk-r28b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/linux/fcntl.h ./usr/include/linux/fcntl.h +--- /home/builder/lib/android-ndk-r28b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/linux/fcntl.h 2025-01-14 21:32:47.000000000 +0000 ++++ ./usr/include/linux/fcntl.h 2025-05-09 18:41:19.822434815 +0000 +@@ -56,7 +56,7 @@ + #define AT_RENAME_NOREPLACE 0x0001 + #define AT_RENAME_EXCHANGE 0x0002 + #define AT_RENAME_WHITEOUT 0x0004 +-#define AT_EACCESS 0x200 ++#define AT_EACCESS 0 + #define AT_REMOVEDIR 0x200 + #define AT_HANDLE_FID 0x200 + #define AT_HANDLE_MNT_ID_UNIQUE 0x001 diff --git a/ndk-patches/27c/paths.h.patch b/ndk-patches/28c/paths.h.patch similarity index 70% rename from ndk-patches/27c/paths.h.patch rename to ndk-patches/28c/paths.h.patch index b5c2684da46d7d..c7999238a4c496 100644 --- a/ndk-patches/27c/paths.h.patch +++ b/ndk-patches/28c/paths.h.patch @@ -1,12 +1,12 @@ ---- ./usr/include/paths.h.orig 2021-08-16 11:55:04.492150066 +0200 -+++ ./usr/include/paths.h 2021-08-16 11:55:42.498804733 +0200 -@@ -40,14 +40,14 @@ +diff -u -r /home/builder/lib/android-ndk-r28b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/paths.h ./usr/include/paths.h +--- /home/builder/lib/android-ndk-r28b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/paths.h 2025-04-14 22:43:37.000000000 +0000 ++++ ./usr/include/paths.h 2025-05-09 18:45:44.121425904 +0000 +@@ -39,13 +39,13 @@ + #include - #ifndef _PATH_BSHELL /** Path to the default system shell. Historically the 'B' was to specify the Bourne shell. */ -#define _PATH_BSHELL "/system/bin/sh" +#define _PATH_BSHELL "@TERMUX_PREFIX@/bin/sh" - #endif /** Path to the system console. */ #define _PATH_CONSOLE "/dev/console" @@ -17,7 +17,7 @@ /** Path to the directory containing device files. */ #define _PATH_DEV "/dev/" -@@ -63,3 +63,9 @@ +@@ -61,3 +61,9 @@ /** Path to the calling process' tty. */ #define _PATH_TTY "/dev/tty" diff --git a/ndk-patches/27c/pwd.h.patch b/ndk-patches/28c/pwd.h.patch similarity index 83% rename from ndk-patches/27c/pwd.h.patch rename to ndk-patches/28c/pwd.h.patch index b7e360392d2f13..b3f94020639c89 100644 --- a/ndk-patches/27c/pwd.h.patch +++ b/ndk-patches/28c/pwd.h.patch @@ -1,11 +1,12 @@ ---- ./usr/include/pwd.h.orig -+++ ./usr/include/pwd.h -@@ -89,13 +89,60 @@ +diff -u -r /home/builder/lib/android-ndk-r28b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/pwd.h ./usr/include/pwd.h +--- /home/builder/lib/android-ndk-r28b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/pwd.h 2024-11-14 00:52:25.000000000 +0000 ++++ ./usr/include/pwd.h 2025-05-09 18:50:20.961428595 +0000 +@@ -89,13 +89,58 @@ struct passwd* _Nullable getpwent(void) __INTRODUCED_IN(26); void setpwent(void) __INTRODUCED_IN(26); -void endpwent(void) __INTRODUCED_IN(26); - #endif /* __ANDROID_API__ >= 26 */ + #endif /* __BIONIC_AVAILABILITY_GUARD(26) */ int getpwnam_r(const char* _Nonnull __name, struct passwd* _Nonnull __pwd, char* _Nonnull __buf, size_t __n, struct passwd* _Nullable * _Nonnull __result); @@ -56,8 +57,6 @@ +#define getpwuid android_polyfill_getpwuid +#define getpwuid_r android_polyfill_getpwuid_r +static void endpwent(void) { /* Do nothing. */ } -+ -+ + __END_DECLS diff --git a/ndk-patches/27c/redefine-TCSAFLUSH.patch b/ndk-patches/28c/redefine-TCSAFLUSH.patch similarity index 100% rename from ndk-patches/27c/redefine-TCSAFLUSH.patch rename to ndk-patches/28c/redefine-TCSAFLUSH.patch diff --git a/ndk-patches/27c/semaphore.h.patch b/ndk-patches/28c/semaphore.h.patch similarity index 100% rename from ndk-patches/27c/semaphore.h.patch rename to ndk-patches/28c/semaphore.h.patch diff --git a/ndk-patches/27c/stdio.h.patch b/ndk-patches/28c/stdio.h.patch similarity index 70% rename from ndk-patches/27c/stdio.h.patch rename to ndk-patches/28c/stdio.h.patch index 0f680b98842a4e..41a1346605bccd 100644 --- a/ndk-patches/27c/stdio.h.patch +++ b/ndk-patches/28c/stdio.h.patch @@ -1,5 +1,6 @@ ---- ./usr/include/stdio.h.orig 2021-08-16 11:48:44.308954400 +0200 -+++ ./usr/include/stdio.h 2021-08-16 11:50:00.438924014 +0200 +diff -u -r /home/builder/lib/android-ndk-r28b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/stdio.h ./usr/include/stdio.h +--- /home/builder/lib/android-ndk-r28b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/stdio.h 2024-11-14 00:52:25.000000000 +0000 ++++ ./usr/include/stdio.h 2025-05-09 18:52:59.008875200 +0000 @@ -44,6 +44,11 @@ #include #include @@ -12,7 +13,7 @@ #include #if __ANDROID_API__ < 24 -@@ -165,7 +166,7 @@ +@@ -149,7 +154,7 @@ __printflike(2, 0) __warnattr_strict("vsprintf is often misused; please use vsnprintf"); char* _Nullable tmpnam(char* _Nullable __s) __warnattr("tmpnam is unsafe, use mkstemp or tmpfile instead"); @@ -21,25 +22,25 @@ char* _Nullable tempnam(const char* _Nullable __dir, const char* _Nullable __prefix) __warnattr("tempnam is unsafe, use mkstemp or tmpfile instead"); -@@ -289,8 +290,6 @@ +@@ -276,8 +281,6 @@ FILE* _Nullable freopen64(const char* _Nullable __path, const char* _Nonnull __mode, FILE* _Nonnull __fp) __INTRODUCED_IN(24); - #endif /* __ANDROID_API__ >= 24 */ + #endif /* __BIONIC_AVAILABILITY_GUARD(24) */ --FILE* _Nullable tmpfile(void); +-__nodiscard FILE* _Nullable tmpfile(void); - - #if __ANDROID_API__ >= 24 - FILE* _Nullable tmpfile64(void) __INTRODUCED_IN(24); - #endif /* __ANDROID_API__ >= 24 */ -@@ -304,10 +303,17 @@ + #if __BIONIC_AVAILABILITY_GUARD(24) + __nodiscard FILE* _Nullable tmpfile64(void) __INTRODUCED_IN(24); + #endif /* __BIONIC_AVAILABILITY_GUARD(24) */ +@@ -291,9 +294,17 @@ #define L_ctermid 1024 /* size for ctermid() */ --#if __ANDROID_API__ >= 26 +-#if __BIONIC_AVAILABILITY_GUARD(26) -char* _Nonnull ctermid(char* _Nullable __buf) __INTRODUCED_IN(26); --#endif /* __ANDROID_API__ >= 26 */ +-#endif /* __BIONIC_AVAILABILITY_GUARD(26) */ +/* Needed by gnulibs freading(). */ +#define __sferror(p) (((p)->_flags & __SERR) != 0) - ++ +/* Used by perl, fish, and others. */ +#if !defined(__swift__) +static __inline__ char* _Nonnull ctermid(char* _Nullable s) { @@ -49,9 +50,9 @@ +} +#endif - FILE* fdopen(int __fd, const char* __mode); - int fileno(FILE* __fp); -@@ -376,6 +380,30 @@ + + __nodiscard FILE* _Nullable fdopen(int __fd, const char* _Nonnull __mode); +@@ -363,6 +374,30 @@ #include #endif diff --git a/ndk-patches/28c/stdlib.h.patch b/ndk-patches/28c/stdlib.h.patch new file mode 100644 index 00000000000000..4839fd4cf29aac --- /dev/null +++ b/ndk-patches/28c/stdlib.h.patch @@ -0,0 +1,34 @@ +diff -u -r /home/builder/lib/android-ndk-r28b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/stdlib.h ./usr/include/stdlib.h +--- /home/builder/lib/android-ndk-r28b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/stdlib.h 2024-11-14 00:52:25.000000000 +0000 ++++ ./usr/include/stdlib.h 2025-05-28 17:41:34.420388013 +0000 +@@ -35,6 +35,9 @@ + #include + #include + #include ++#if !defined(__swift__) ++#include ++#endif + #include + + __BEGIN_DECLS +@@ -217,9 +220,7 @@ + void setprogname(const char* _Nonnull __name); + + +-#if __BIONIC_AVAILABILITY_GUARD(26) +-int mblen(const char* _Nullable __s, size_t __n) __INTRODUCED_IN(26); ++int mblen(const char* _Nullable __s, size_t __n); +-#endif /* __BIONIC_AVAILABILITY_GUARD(26) */ + + size_t mbstowcs(wchar_t* _Nullable __dst, const char* _Nullable __src, size_t __n); + int mbtowc(wchar_t* _Nullable __wc_ptr, const char* _Nullable __s, size_t __n); +@@ -227,8 +228,7 @@ + + size_t wcstombs(char* _Nullable __dst, const wchar_t* _Nullable __src, size_t __n); + +-size_t __ctype_get_mb_cur_max(void); +-#define MB_CUR_MAX __ctype_get_mb_cur_max() ++#define MB_CUR_MAX 4 + + #if defined(__BIONIC_INCLUDE_FORTIFY_HEADERS) + #include diff --git a/ndk-patches/27c/sys-cdefs.h.patch b/ndk-patches/28c/sys-cdefs.h.patch similarity index 100% rename from ndk-patches/27c/sys-cdefs.h.patch rename to ndk-patches/28c/sys-cdefs.h.patch diff --git a/ndk-patches/27c/sys-time.h.patch b/ndk-patches/28c/sys-time.h.patch similarity index 59% rename from ndk-patches/27c/sys-time.h.patch rename to ndk-patches/28c/sys-time.h.patch index bfeb0338eda373..9de0b6d26006ee 100644 --- a/ndk-patches/27c/sys-time.h.patch +++ b/ndk-patches/28c/sys-time.h.patch @@ -1,13 +1,14 @@ ---- ./usr/include/sys/time.h.orig 2024-03-21 21:20:39.291006515 +0000 -+++ ./usr/include/sys/time.h 2024-03-23 15:15:08.754434710 +0000 +diff -u -r /home/builder/lib/android-ndk-r28b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/sys/time.h ./usr/include/sys/time.h +--- /home/builder/lib/android-ndk-r28b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/sys/time.h 2024-11-14 00:52:25.000000000 +0000 ++++ ./usr/include/sys/time.h 2025-05-09 18:58:25.785705103 +0000 @@ -48,10 +48,8 @@ #if defined(__USE_BSD) --#if __ANDROID_API__ >= 26 +-#if __BIONIC_AVAILABILITY_GUARD(26) -int futimes(int __fd, const struct timeval __times[_Nullable 2]) __INTRODUCED_IN(26); -int lutimes(const char* _Nonnull __path, const struct timeval __times[_Nullable 2]) __INTRODUCED_IN(26); --#endif /* __ANDROID_API__ >= 26 */ +-#endif /* __BIONIC_AVAILABILITY_GUARD(26) */ +int futimes(int __fd, const struct timeval __times[_Nullable 2]); +int lutimes(const char* _Nonnull __path, const struct timeval __times[_Nullable 2]); @@ -17,9 +18,9 @@ * Available since API level 26. */ --#if __ANDROID_API__ >= 26 +-#if __BIONIC_AVAILABILITY_GUARD(26) -int futimesat(int __dir_fd, const char* __BIONIC_COMPLICATED_NULLNESS __path, const struct timeval __times[_Nullable 2]) __INTRODUCED_IN(26); --#endif /* __ANDROID_API__ >= 26 */ +-#endif /* __BIONIC_AVAILABILITY_GUARD(26) */ +int futimesat(int __dir_fd, const char* __BIONIC_COMPLICATED_NULLNESS __path, const struct timeval __times[_Nullable 2]); #endif diff --git a/ndk-patches/27c/syslog.patch b/ndk-patches/28c/syslog.patch similarity index 100% rename from ndk-patches/27c/syslog.patch rename to ndk-patches/28c/syslog.patch diff --git a/ndk-patches/27c/time.h.patch b/ndk-patches/28c/time.h.patch similarity index 100% rename from ndk-patches/27c/time.h.patch rename to ndk-patches/28c/time.h.patch diff --git a/ndk-patches/27c/unistd.h.patch b/ndk-patches/28c/unistd.h.patch similarity index 100% rename from ndk-patches/27c/unistd.h.patch rename to ndk-patches/28c/unistd.h.patch diff --git a/ndk-patches/27c/utmp.h.patch b/ndk-patches/28c/utmp.h.patch similarity index 100% rename from ndk-patches/27c/utmp.h.patch rename to ndk-patches/28c/utmp.h.patch diff --git a/packages/libandroid-stub/build.sh b/packages/libandroid-stub/build.sh index eede26dced4cad..d07fd6e455fbba 100644 --- a/packages/libandroid-stub/build.sh +++ b/packages/libandroid-stub/build.sh @@ -4,8 +4,7 @@ TERMUX_PKG_LICENSE="NCSA" TERMUX_PKG_MAINTAINER="@termux" # Version should be equal to TERMUX_NDK_{VERSION_NUM,REVISION} in # scripts/properties.sh -TERMUX_PKG_VERSION=27c -TERMUX_PKG_REVISION=3 +TERMUX_PKG_VERSION=28c TERMUX_PKG_AUTO_UPDATE=false TERMUX_PKG_CONFLICTS="libandroid" TERMUX_PKG_REPLACES="libandroid" diff --git a/packages/libc++/build.sh b/packages/libc++/build.sh index a573e9439cd229..ed3182600f4095 100644 --- a/packages/libc++/build.sh +++ b/packages/libc++/build.sh @@ -4,7 +4,7 @@ TERMUX_PKG_LICENSE="NCSA" TERMUX_PKG_MAINTAINER="@termux" # Version should be equal to TERMUX_NDK_{VERSION_NUM,REVISION} in # scripts/properties.sh -TERMUX_PKG_VERSION=27c +TERMUX_PKG_VERSION=28c TERMUX_PKG_SRCURL=https://dl.google.com/android/repository/android-ndk-r${TERMUX_PKG_VERSION}-linux.zip TERMUX_PKG_SHA256=59c2f6dc96743b5daf5d1626684640b20a6bd2b1d85b13156b90333741bad5cc TERMUX_PKG_AUTO_UPDATE=false diff --git a/packages/ndk-multilib/build.sh b/packages/ndk-multilib/build.sh index 6a05ef24a38a15..8395ecf3dd02dc 100644 --- a/packages/ndk-multilib/build.sh +++ b/packages/ndk-multilib/build.sh @@ -4,7 +4,7 @@ TERMUX_PKG_LICENSE="NCSA" TERMUX_PKG_MAINTAINER="@termux" # Version should be equal to TERMUX_NDK_{VERSION_NUM,REVISION} in # scripts/properties.sh -TERMUX_PKG_VERSION=27c +TERMUX_PKG_VERSION=28c TERMUX_PKG_SRCURL=https://dl.google.com/android/repository/android-ndk-r${TERMUX_PKG_VERSION}-linux.zip TERMUX_PKG_SHA256=59c2f6dc96743b5daf5d1626684640b20a6bd2b1d85b13156b90333741bad5cc TERMUX_PKG_AUTO_UPDATE=false diff --git a/packages/ndk-sysroot/build.sh b/packages/ndk-sysroot/build.sh index 27a92c6f33f2a3..ef7b94c62967e0 100644 --- a/packages/ndk-sysroot/build.sh +++ b/packages/ndk-sysroot/build.sh @@ -4,7 +4,7 @@ TERMUX_PKG_LICENSE="NCSA" TERMUX_PKG_MAINTAINER="@termux" # Version should be equal to TERMUX_NDK_{VERSION_NUM,REVISION} in # scripts/properties.sh -TERMUX_PKG_VERSION=27c +TERMUX_PKG_VERSION=28c TERMUX_PKG_SRCURL=https://dl.google.com/android/repository/android-ndk-r${TERMUX_PKG_VERSION}-linux.zip TERMUX_PKG_SHA256=59c2f6dc96743b5daf5d1626684640b20a6bd2b1d85b13156b90333741bad5cc TERMUX_PKG_AUTO_UPDATE=false @@ -90,9 +90,9 @@ termux_step_make_install() { test $NDK_ARCH == 'i686' && NDK_ARCH='i386' # clang 13 requires libunwind on Android. - cp toolchains/llvm/prebuilt/linux-x86_64/lib/clang/18/lib/linux/$NDK_ARCH/libatomic.a \ + cp toolchains/llvm/prebuilt/linux-x86_64/lib/clang/19/lib/linux/$NDK_ARCH/libatomic.a \ $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib - cp toolchains/llvm/prebuilt/linux-x86_64/lib/clang/18/lib/linux/$NDK_ARCH/libunwind.a \ + cp toolchains/llvm/prebuilt/linux-x86_64/lib/clang/19/lib/linux/$NDK_ARCH/libunwind.a \ $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib # librt and libpthread are built into libc on android, so setup them as symlinks diff --git a/packages/vulkan-loader-android/build.sh b/packages/vulkan-loader-android/build.sh index 564281f09129c3..415db565cc9a1c 100644 --- a/packages/vulkan-loader-android/build.sh +++ b/packages/vulkan-loader-android/build.sh @@ -4,7 +4,7 @@ TERMUX_PKG_LICENSE="NCSA" TERMUX_PKG_MAINTAINER="@termux" # Version should be equal to TERMUX_NDK_{VERSION_NUM,REVISION} in # scripts/properties.sh -TERMUX_PKG_VERSION=27c +TERMUX_PKG_VERSION=28c TERMUX_PKG_SRCURL=https://dl.google.com/android/repository/android-ndk-r${TERMUX_PKG_VERSION}-linux.zip TERMUX_PKG_SHA256=59c2f6dc96743b5daf5d1626684640b20a6bd2b1d85b13156b90333741bad5cc TERMUX_PKG_AUTO_UPDATE=false diff --git a/scripts/build/termux_step_setup_toolchain.sh b/scripts/build/termux_step_setup_toolchain.sh index 9705f9e734e250..fff165fee3bbbf 100644 --- a/scripts/build/termux_step_setup_toolchain.sh +++ b/scripts/build/termux_step_setup_toolchain.sh @@ -6,9 +6,9 @@ termux_step_setup_toolchain() { # Bump TERMUX_STANDALONE_TOOLCHAIN if a change is made in # toolchain setup to ensure that everyone gets an updated # toolchain - if [ "${TERMUX_NDK_VERSION}" = "27c" ]; then + if [ "${TERMUX_NDK_VERSION}" = "28c" ]; then TERMUX_STANDALONE_TOOLCHAIN+="-v1" - termux_setup_toolchain_27c + termux_setup_toolchain_28c elif [ "${TERMUX_NDK_VERSION}" = 23c ]; then TERMUX_STANDALONE_TOOLCHAIN+="-v8" termux_setup_toolchain_23c diff --git a/scripts/build/toolchain/termux_setup_toolchain_27c.sh b/scripts/build/toolchain/termux_setup_toolchain_28c.sh similarity index 99% rename from scripts/build/toolchain/termux_setup_toolchain_27c.sh rename to scripts/build/toolchain/termux_setup_toolchain_28c.sh index 2a704c3148696f..829e4294649dd7 100644 --- a/scripts/build/toolchain/termux_setup_toolchain_27c.sh +++ b/scripts/build/toolchain/termux_setup_toolchain_28c.sh @@ -1,4 +1,4 @@ -termux_setup_toolchain_27c() { +termux_setup_toolchain_28c() { export CFLAGS="" export CPPFLAGS="" export LDFLAGS="-L${TERMUX__PREFIX__LIB_DIR}" diff --git a/scripts/properties.sh b/scripts/properties.sh index b98c3a46906481..c40fbba0898c28 100644 --- a/scripts/properties.sh +++ b/scripts/properties.sh @@ -305,7 +305,7 @@ TERMUX_ANDROID_BUILD_TOOLS_VERSION=33.0.1 # change TERMUX_PKG_VERSION (and remove TERMUX_PKG_REVISION if necessary) in: # apksigner, d8 # and trigger rebuild of them -: "${TERMUX_NDK_VERSION_NUM:="27"}" +: "${TERMUX_NDK_VERSION_NUM:="28"}" : "${TERMUX_NDK_REVISION:="c"}" TERMUX_NDK_VERSION="${TERMUX_NDK_VERSION_NUM}${TERMUX_NDK_REVISION}" # when changing the above: diff --git a/scripts/setup-android-sdk.sh b/scripts/setup-android-sdk.sh index 827e982b0a5688..09b11240c4e7a0 100755 --- a/scripts/setup-android-sdk.sh +++ b/scripts/setup-android-sdk.sh @@ -10,9 +10,9 @@ set -e -u ANDROID_SDK_FILE=commandlinetools-linux-${TERMUX_SDK_REVISION}_latest.zip ANDROID_SDK_SHA256=0bebf59339eaa534f4217f8aa0972d14dc49e7207be225511073c661ae01da0a -if [ "$TERMUX_NDK_VERSION" = "27c" ]; then +if [ "$TERMUX_NDK_VERSION" = "28c" ]; then ANDROID_NDK_FILE=android-ndk-r${TERMUX_NDK_VERSION}-linux.zip - ANDROID_NDK_SHA256=59c2f6dc96743b5daf5d1626684640b20a6bd2b1d85b13156b90333741bad5cc + ANDROID_NDK_SHA256=dfb20d396df28ca02a8c708314b814a4d961dc9074f9a161932746f815aa552f elif [ "$TERMUX_NDK_VERSION" = 23c ]; then ANDROID_NDK_FILE=android-ndk-r${TERMUX_NDK_VERSION}-linux.zip ANDROID_NDK_SHA256=6ce94604b77d28113ecd588d425363624a5228d9662450c48d2e4053f8039242