-
Notifications
You must be signed in to change notification settings - Fork 11
/
swift-android-stdlib-except-trunk.patch
30 lines (29 loc) · 1.59 KB
/
swift-android-stdlib-except-trunk.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
diff --git a/swift/stdlib/cmake/modules/AddSwiftStdlib.cmake b/swift/stdlib/cmake/modules/AddSwiftStdlib.cmake
index 61447d50f08..b533b9291af 100644
--- a/swift/stdlib/cmake/modules/AddSwiftStdlib.cmake
+++ b/swift/stdlib/cmake/modules/AddSwiftStdlib.cmake
@@ -522,7 +522,11 @@ function(_add_target_variant_link_flags)
# We need to add the math library, which is linked implicitly by libc++
list(APPEND result "-lm")
if(NOT "${SWIFT_ANDROID_NDK_PATH}" STREQUAL "")
- file(GLOB RESOURCE_DIR ${SWIFT_SDK_ANDROID_ARCH_${LFLAGS_ARCH}_PATH}/../lib64/clang/*)
+ if("${SWIFT_ANDROID_NDK_PATH}" MATCHES "ndk/26")
+ file(GLOB RESOURCE_DIR ${SWIFT_SDK_ANDROID_ARCH_${LFLAGS_ARCH}_PATH}/../lib/clang/*)
+ else()
+ file(GLOB RESOURCE_DIR ${SWIFT_SDK_ANDROID_ARCH_${LFLAGS_ARCH}_PATH}/../lib64/clang/*)
+ endif()
list(APPEND result "-resource-dir=${RESOURCE_DIR}")
endif()
diff --git a/swift/stdlib/private/SwiftPrivateLibcExtras/SwiftPrivateLibcExtras.swift b/swift/stdlib/private/SwiftPrivateLibcExtras/SwiftPrivateLibcExtras.swift
index f8daa50325c..66be85a77f0 100644
--- a/swift/stdlib/private/SwiftPrivateLibcExtras/SwiftPrivateLibcExtras.swift
+++ b/swift/stdlib/private/SwiftPrivateLibcExtras/SwiftPrivateLibcExtras.swift
@@ -131,6 +131,8 @@ public func _stdlib_pipe() -> (readEnd: CInt, writeEnd: CInt, error: CInt) {
return _pipe(unsafeFds.baseAddress, 0, 0)
#elseif os(WASI)
preconditionFailure("No pipes available on WebAssembly/WASI")
+#elseif os(Android)
+ return pipe(unsafeFds.baseAddress!)
#else
return pipe(unsafeFds.baseAddress)
#endif