Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
3594055
Support building natively on Android (bionic) hosts
hpr Aug 12, 2026
c04a356
Add Android cross-compilation CI job
hpr Aug 16, 2026
ea77ece
Add workflow_dispatch trigger to build workflow
hpr Aug 16, 2026
784095f
Fix toolchain extraction: tarballs are gzip, not xz
hpr Aug 16, 2026
60de7d7
Locate installed Android SDK bundle robustly (cache vs swift-sdks)
hpr Aug 16, 2026
ed8d23b
Search all SwiftPM state dirs for the installed Android bundle
hpr Aug 16, 2026
86043c2
Install Android SDK from local file so it registers in swift-sdks
hpr Aug 16, 2026
25994b9
Use the Android SDK's API-level-suffixed triple (android28)
hpr Aug 16, 2026
bedbcd6
Cross-build native libs for Android CI; validate installed SDKs
hpr Aug 16, 2026
96f5f02
OpenSSL: build_libs/install_dev, not build_swift
hpr Aug 16, 2026
4fc9b0f
CI: temporarily mirror xtool-core to the bionic-guards fork
hpr Aug 16, 2026
1791c17
Cross-build libcurl for libimobiledevice (mobileactivation)
hpr Aug 16, 2026
4f68930
Build libcurl before libtatsu (tatsu configure requires it)
hpr Aug 16, 2026
f05f0a3
Cross-build zlib before curl (NDK ships no zlib.pc)
hpr Aug 16, 2026
6b499d4
Fetch zlib from GitHub releases (zlib.net flakes on CI)
hpr Aug 16, 2026
6bd1a47
Build zlib with -fPIC (tatsu links it into a shared lib)
hpr Aug 16, 2026
d239808
Provide .tarball-version for libimobiledevice git snapshot
hpr Aug 16, 2026
7e7b9e5
libimobiledevice: bionic has pthread_once in libc, not libpthread
hpr Aug 16, 2026
880392c
libimobiledevice: fix cache var name for the pthread_once probe
hpr Aug 16, 2026
cb6c956
Provide empty libpthread.a (bionic pthreads live in libc)
hpr Aug 16, 2026
d6cfa24
Export CPPFLAGS/LDFLAGS so bare link probes find the prefix
hpr Aug 16, 2026
39f5aa8
CI: mirror unxip fork; generate pkg-config files for the sysroot
hpr Aug 16, 2026
af5f878
CI: rewrite unxip pin to fork (mirrors don't retarget pinned deps)
hpr Aug 16, 2026
fc2bbb8
CI: re-apply unxip pin after resolution (update recomputes it)
hpr Aug 16, 2026
fe91a96
Build xz before installing headers into the sysroot
hpr Aug 16, 2026
f5c58cf
CI: re-apply xtool-core pin after resolution too
hpr Aug 16, 2026
a5557f7
Pass --target to the final link (Swift driver omits it)
hpr Aug 16, 2026
a922792
Link fix: explicit lld aarch64 emulation; verbose retry on failure
hpr Aug 16, 2026
bc055e5
Wrap -Xclang-linker in -Xswiftc (swift build rejects it bare)
hpr Aug 16, 2026
3b68c4e
Shim ld.lld on PATH to inject aarch64 emulation for the final link
hpr Aug 17, 2026
0af2a11
Inject aarch64 lld emulation via the SDK toolset, not a PATH shim
hpr Aug 17, 2026
b7b3716
Toolset linker opts go verbatim to lld: use raw -m aarch64elf
hpr Aug 17, 2026
fad064c
DIAG: probe ld.lld -m handling (rsp vs argv) + verbose link dump
hpr Aug 17, 2026
3e6632a
DIAG: wrap ld.lld to capture the actual response file bytes
hpr Aug 17, 2026
d4af07f
DIAG: rerun real lld on captured rsp + token-prefix bisect
hpr Aug 17, 2026
9ff98f3
DIAG: preserve argv[0] in ld.lld wrapper and reruns
hpr Aug 17, 2026
ac3d154
Fix Android cross link: scope pkg-config to the cross sysroot
hpr Aug 17, 2026
955652f
DIAG: dump -L tokens of captured response file + pkg-config env
hpr Aug 17, 2026
c8b19ea
android CI: fix pkgconfig output dir to match PKG_CONFIG_PATH
hpr Aug 17, 2026
9e13cda
android CI: fix libtatsu link flag in generated .pc
hpr Aug 17, 2026
1066ff1
android CI: strip zstd debug sections from NDK static archives
hpr Aug 17, 2026
afc4d34
android CI: verify zstd debug strip took effect
hpr Aug 17, 2026
c64806d
android CI: follow symlinks when stripping NDK static archives
hpr Aug 17, 2026
bdab97a
android CI: tolerate unstrippable NDK archives
hpr Aug 17, 2026
3cef627
android CI: drop link diagnostics, verify product ELF
hpr Aug 17, 2026
163780c
Drop redundant libstdc++->libc++ mapping
hpr Aug 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ let package = Package(
.product(
name: "Subprocess",
package: "swift-subprocess",
condition: .when(platforms: [.linux, .macOS])
condition: .when(platforms: [.linux, .macOS, .android])
),
]
),
Expand All @@ -110,7 +110,7 @@ let package = Package(
"DeveloperAPI",
"CXKit",
"XUtils",
.byName(name: "XADI", condition: .when(platforms: [.linux])),
.byName(name: "XADI", condition: .when(platforms: [.linux, .android])),
.product(name: "ConcurrencyExtras", package: "swift-concurrency-extras"),
.product(name: "Dependencies", package: "swift-dependencies"),
.product(name: "SwiftyMobileDevice", package: "SwiftyMobileDevice"),
Expand All @@ -128,17 +128,17 @@ let package = Package(
.product(
name: "OpenAPIAsyncHTTPClient",
package: "swift-openapi-async-http-client",
condition: .when(platforms: [.linux])
condition: .when(platforms: [.linux, .android])
),
.product(
name: "AsyncHTTPClient",
package: "async-http-client",
condition: .when(platforms: [.linux])
condition: .when(platforms: [.linux, .android])
),
.product(
name: "WebSocketKit",
package: "websocket-kit",
condition: .when(platforms: [.linux])
condition: .when(platforms: [.linux, .android])
),
],
cSettings: cSettings
Expand Down
2 changes: 1 addition & 1 deletion Sources/XKit/HTTPClientProtocol/AsyncHTTPClient+HTTP.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Kabir Oberai on 05/05/21.
//

#if os(Linux)
#if os(Linux) || os(Android)
import Foundation
import AsyncHTTPClient
import NIO
Expand Down
2 changes: 1 addition & 1 deletion Sources/XKit/HTTPClientProtocol/URLSession+HTTP.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Kabir Oberai on 05/05/21.
//

#if !os(Linux)
#if !os(Linux) && !os(Android)
import Foundation
import ConcurrencyExtras
import OpenAPIRuntime
Expand Down
10 changes: 10 additions & 0 deletions Sources/XKit/Utilities/CHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,20 @@

import Foundation
import CXKit
#if os(Android)
import Android
#endif

#if os(Android)
// bionic's FILE is an incomplete type, imported as OpaquePointer
package var stdoutSafe: OpaquePointer {
get_stdout()
}
#else
package var stdoutSafe: UnsafeMutablePointer<FILE> {
get_stdout()
}
#endif

extension Data {
init?(deallocator: Deallocator = .free, acceptor: (inout Int) -> UnsafeMutableRawPointer?) {
Expand Down
5 changes: 4 additions & 1 deletion Sources/XToolSupport/XTool.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import Foundation
#if os(Android)
import Android
#endif
import XKit
import ArgumentParser
import XUtils
Expand Down Expand Up @@ -74,7 +77,7 @@ extension ParsableCommand where Self: SendableMetatype {
}
}

signal(SIGINT, SIG_IGN)
_ = signal(SIGINT, SIG_IGN)
let source = DispatchSource.makeSignalSource(signal: SIGINT)
source.setEventHandler { task.cancel() }
source.resume()
Expand Down
3 changes: 3 additions & 0 deletions Sources/XUtils/System+Utils.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import Foundation
#if os(Android)
import Android
#endif

#if canImport(System)
import System
Expand Down