diff --git a/Package.swift b/Package.swift index 2b5b5e0534..4a9dc5dc71 100644 --- a/Package.swift +++ b/Package.swift @@ -26,7 +26,7 @@ if let environmentPath = Context.environment["DISPATCH_INCLUDE_PATH"] { .unsafeFlags([ "-I/usr/lib/swift", "-I/usr/lib/swift/Block" - ], .when(platforms: [.linux, .android])) + ], .when(platforms: [.linux])) ) if let sdkRoot = Context.environment["SDKROOT"] { dispatchIncludeFlags.append(.unsafeFlags([ @@ -245,7 +245,8 @@ let package = Package( "BlockRuntime", "CMakeLists.txt" ], - cSettings: coreFoundationBuildSettings + cSettings: coreFoundationBuildSettings, + linkerSettings: [.linkedLibrary("log", .when(platforms: [.android]))] ), .target( name: "BlocksRuntime", @@ -262,7 +263,7 @@ let package = Package( name: "_CFXMLInterface", dependencies: [ "CoreFoundation", - .target(name: "Clibxml2", condition: .when(platforms: [.linux])), + .target(name: "Clibxml2", condition: .when(platforms: [.linux, .android])), ], path: "Sources/_CFXMLInterface", exclude: [ @@ -275,7 +276,7 @@ let package = Package( name: "_CFURLSessionInterface", dependencies: [ "CoreFoundation", - .target(name: "Clibcurl", condition: .when(platforms: [.linux])), + .target(name: "Clibcurl", condition: .when(platforms: [.linux, .android])), ], path: "Sources/_CFURLSessionInterface", exclude: [ @@ -348,7 +349,7 @@ let package = Package( "FoundationNetworking", "XCTest", "Testing", - .target(name: "xdgTestHelper", condition: .when(platforms: [.linux])) + .target(name: "xdgTestHelper", condition: .when(platforms: [.linux, .android])) ], resources: [ .copy("Foundation/Resources") diff --git a/Sources/CoreFoundation/CFPlatform.c b/Sources/CoreFoundation/CFPlatform.c index 83fbfd7743..90f4aa78df 100644 --- a/Sources/CoreFoundation/CFPlatform.c +++ b/Sources/CoreFoundation/CFPlatform.c @@ -2283,7 +2283,7 @@ CF_EXPORT int _CFPosixSpawnFileActionsChdir(_CFPosixSpawnFileActionsRef file_act // Glibc versions prior to 2.29 don't support posix_spawn_file_actions_addchdir_np, impacting: // - Amazon Linux 2 (EoL mid-2025) return ENOSYS; - #elif defined(__GLIBC__) || TARGET_OS_DARWIN || defined(__FreeBSD__) || defined(__ANDROID__) || defined(__musl__) + #elif defined(__GLIBC__) || TARGET_OS_DARWIN || defined(__FreeBSD__) || (defined(__ANDROID__) && __ANDROID_API__ >= 34) || defined(__musl__) // Pre-standard posix_spawn_file_actions_addchdir_np version available in: // - Solaris 11.3 (October 2015) // - Glibc 2.29 (February 2019)