-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathswift-android-ci.patch
100 lines (95 loc) · 3.37 KB
/
swift-android-ci.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
diff --git a/llbuild/CMakeLists.txt b/llbuild/CMakeLists.txt
index 766e38e7..ad4d369f 100644
--- a/llbuild/CMakeLists.txt
+++ b/llbuild/CMakeLists.txt
@@ -158,6 +158,7 @@ elseif(MSVC)
else ()
add_compile_options(
# Enable additional Clang warnings.
+ "$<$<COMPILE_LANGUAGE:CXX>:-D_FORTIFY_SOURCE=0>"
"$<$<COMPILE_LANGUAGE:CXX>:-fno-rtti>"
"$<$<COMPILE_LANGUAGE:CXX>:-fno-exceptions>"
"$<$<COMPILE_LANGUAGE:CXX>:-Wbool-conversion>"
diff --git a/llbuild/lib/llvm/Support/CMakeLists.txt b/llbuild/lib/llvm/Support/CMakeLists.txt
index 9d5a714b..3f8f8c1d 100644
--- a/llbuild/lib/llvm/Support/CMakeLists.txt
+++ b/llbuild/lib/llvm/Support/CMakeLists.txt
@@ -66,4 +66,15 @@ endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Android|Darwin|Linux")
target_link_libraries(llvmSupport PRIVATE curses)
+if(${CMAKE_SYSTEM_NAME} MATCHES "Android")
+ target_link_libraries(llvmSupport PRIVATE android-spawn)
+ list(GET CMAKE_FIND_ROOT_PATH 0 SPAWN_DIR)
+ target_include_directories(llvmSupport
+ PUBLIC
+ ${SPAWN_DIR}/usr/include
+ )
+ target_link_directories(llvmSupport PUBLIC
+ ${SPAWN_DIR}/usr/lib
+ )
+endif()
endif()
diff --git a/llbuild/unittests/CMakeLists.txt b/llbuild/unittests/CMakeLists.txt
index 92a1ee38..52273afb 100644
--- a/llbuild/unittests/CMakeLists.txt
+++ b/llbuild/unittests/CMakeLists.txt
@@ -6,4 +6,4 @@ function(add_llbuild_unittest test_dirname)
add_subdirectory(CAPI)
add_subdirectory(Core)
add_subdirectory(BuildSystem)
-add_subdirectory(Ninja)
+#add_subdirectory(Ninja)
diff --git a/swift-argument-parser/Sources/ArgumentParser/Utilities/Platform.swift b/swift-argument-parser/Sources/ArgumentParser/Utilities/Platform.swift
index b7fa046..a94e3b8 100644
--- a/swift-argument-parser/Sources/ArgumentParser/Utilities/Platform.swift
+++ b/swift-argument-parser/Sources/ArgumentParser/Utilities/Platform.swift
@@ -19,6 +19,8 @@ import Darwin
import CRT
#elseif canImport(WASILibc)
import WASILibc
+#elseif canImport(Android)
+import Android
#endif
enum Platform {}
@@ -88,6 +90,8 @@ extension Platform {
ucrt._exit(code)
#elseif canImport(WASILibc)
WASILibc.exit(code)
+#elseif canImport(Android)
+ Android.exit(code)
#endif
}
}
@@ -108,7 +112,7 @@ extension Platform {
// MARK: Terminal size
-#if canImport(Glibc)
+#if canImport(Glibc) || canImport(Android)
func ioctl(_ a: Int32, _ b: Int32, _ p: UnsafeMutableRawPointer) -> Int32 {
ioctl(CInt(a), UInt(b), p)
}
diff --git a/swift-certificates/Sources/X509/Verifier/RFC5280/URIConstraints.swift b/swift-certificates/Sources/X509/Verifier/RFC5280/URIConstraints.swift
--- a/swift-certificates/Sources/X509/Verifier/RFC5280/URIConstraints.swift
+++ b/swift-certificates/Sources/X509/Verifier/RFC5280/URIConstraints.swift
@@ -21,6 +21,9 @@
#elseif canImport(Musl)
import Musl
import CoreFoundation
+#elseif canImport(Android)
+import Android
+import CoreFoundation
#elseif canImport(Darwin)
import Darwin
#endif
diff --git a/swift-crypto/Sources/Crypto/Key Derivation/HKDF.swift b/swift-crypto/Sources/Crypto/Key Derivation/HKDF.swift
index 5f47c2f..4b5579e 100644
--- a/swift-crypto/Sources/Crypto/Key Derivation/HKDF.swift
+++ b/swift-crypto/Sources/Crypto/Key Derivation/HKDF.swift
@@ -15,6 +15,9 @@
@_exported import CryptoKit
#else
import Foundation
+#if canImport(Android)
+import Android
+#endif
/// A standards-based implementation of an HMAC-based Key Derivation Function
/// (HKDF).