From c84d953c7976b22a939e005fd3558f9a9c51800b Mon Sep 17 00:00:00 2001 From: Ken Tominaga Date: Tue, 21 Apr 2026 00:46:41 -0700 Subject: [PATCH] JavaScriptKit: import Android module for non-Wasm Android targets Building JavaScriptKit for the Swift 6.3 Android SDK triples (e.g. aarch64-unknown-linux-android28, x86_64-unknown-linux-android30) fails in ThreadLocal.swift with: error: cannot find 'pthread_key_create' in scope error: cannot find 'pthread_key_t' in scope Android uses Bionic, exposed to Swift as the `Android` module, rather than Glibc. The existing conditional falls through to `#error("Unsupported platform")` on Android. Add a `canImport(Android)` branch between the Darwin and Glibc branches, matching the pattern already used by Foundation and swift-corelibs-libdispatch. No Wasm, Darwin, or Glibc behavior changes. --- Sources/JavaScriptKit/ThreadLocal.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/JavaScriptKit/ThreadLocal.swift b/Sources/JavaScriptKit/ThreadLocal.swift index e92ca32ac..12bf78773 100644 --- a/Sources/JavaScriptKit/ThreadLocal.swift +++ b/Sources/JavaScriptKit/ThreadLocal.swift @@ -4,6 +4,8 @@ import wasi_pthread #endif #elseif canImport(Darwin) import Darwin +#elseif canImport(Android) +import Android #elseif canImport(Glibc) import Glibc #else