diff --git a/.github/workflows/sdks.yml b/.github/workflows/sdks.yml index 2c56f58a..0e8cb474 100644 --- a/.github/workflows/sdks.yml +++ b/.github/workflows/sdks.yml @@ -115,7 +115,7 @@ jobs: else sed -i "s%r26%ndk/26%" swift/stdlib/cmake/modules/AddSwiftStdlib.cmake if [ ${{ matrix.version }} = 'devel' ]; then - git apply -C1 libdispatch-alloc.patch + git apply -C1 libdispatch-alloc.patch readlink-devel.patch fi STUPID_FILE_RENAMING=Command fi @@ -132,9 +132,9 @@ jobs: sed -i "s%#include \n#include \n#include \n#include \n#include \n#include +Date: Wed May 8 20:16:15 2024 -0700 + + stdlib: fix android build + + the readlink addition in f4bf278 was introduced without a corresponding include. + +diff --git a/swift/stdlib/public/runtime/Paths.cpp b/swift/stdlib/public/runtime/Paths.cpp +index 131a24ed405..174140238ba 100644 +--- a/swift/stdlib/public/runtime/Paths.cpp ++++ b/swift/stdlib/public/runtime/Paths.cpp +@@ -49,6 +49,11 @@ + #include + #endif + ++#ifdef __linux__ ++// Needed for 'readlink'. ++#include ++#endif ++ + #include + #include + #include diff --git a/swift-android-stdlib-ndk25-trunk.patch b/swift-android-stdlib-ndk25-trunk.patch new file mode 100644 index 00000000..c64c72a3 --- /dev/null +++ b/swift-android-stdlib-ndk25-trunk.patch @@ -0,0 +1,13 @@ +diff --git a/swift/stdlib/public/SwiftShims/swift/shims/LibcShims.h b/swift/stdlib/public/SwiftShims/swift/shims/LibcShims.h +index 6a34bc4746a..bc4a02a6eed 100644 +--- a/swift/stdlib/public/SwiftShims/swift/shims/LibcShims.h ++++ b/swift/stdlib/public/SwiftShims/swift/shims/LibcShims.h +@@ -61,7 +61,7 @@ SWIFT_READONLY + static inline int _swift_stdlib_memcmp(const void *s1, const void *s2, + __swift_size_t n) { + // FIXME: Is there a way to identify Glibc specifically? +-#if defined(__gnu_linux__) || defined(__ANDROID__) || defined(__musl__) ++#if defined(__gnu_linux__) || defined(__musl__) + extern int memcmp(const void * _Nonnull, const void * _Nonnull, __swift_size_t); + #else + extern int memcmp(const void * _Null_unspecified, const void * _Null_unspecified, __swift_size_t);