Skip to content

Commit 5d40a35

Browse files
committed
Apply Marc's upstream llbuild patch to the devel branch on the CI too
1 parent 4ebf537 commit 5d40a35

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

swift-android-ci-except-release.patch

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,38 @@ index 2135ce6..fbff6f6 100644
110110
#else
111111
public import SWBLibc
112112
#endif
113+
From: Marc Prud'hommeaux <[email protected]>
114+
Date: Wed, 7 May 2025 10:24:19 -0400
115+
116+
diff --git a/llbuild/lib/Basic/Subprocess.cpp b/llbuild/lib/Basic/Subprocess.cpp
117+
index bf2fd4d1..8d4ee3de 100644
118+
--- a/llbuild/lib/Basic/Subprocess.cpp
119+
+++ b/llbuild/lib/Basic/Subprocess.cpp
120+
@@ -79,9 +79,12 @@ int pthread_fchdir_np(int fd)
121+
// Implementation mostly copied from _CFPosixSpawnFileActionsChdir in swift-corelibs-foundation
122+
static int posix_spawn_file_actions_addchdir_polyfill(posix_spawn_file_actions_t * __restrict file_actions,
123+
const char * __restrict path) {
124+
-#if defined(__GLIBC__) && !__GLIBC_PREREQ(2, 29)
125+
+#if (defined(__GLIBC__) && !__GLIBC_PREREQ(2, 29)) || (defined(__OpenBSD__)) || (defined(__ANDROID__) && __ANDROID_API__ < 34)
126+
// Glibc versions prior to 2.29 don't support posix_spawn_file_actions_addchdir_np, impacting:
127+
// - Amazon Linux 2 (EoL mid-2025)
128+
+ // Currently missing as of:
129+
+ // - OpenBSD 7.5 (April 2024)
130+
+ // - Android <= 14
131+
return ENOSYS;
132+
#elif defined(__APPLE__) && defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500
133+
// Conditionally available on macOS if building with a deployment target older than 10.15
134+
@@ -89,10 +92,6 @@ static int posix_spawn_file_actions_addchdir_polyfill(posix_spawn_file_actions_t
135+
return posix_spawn_file_actions_addchdir_np(file_actions, path);
136+
}
137+
return ENOSYS;
138+
-#elif defined(__OpenBSD__)
139+
- // Currently missing as of:
140+
- // - OpenBSD 7.5 (April 2024)
141+
- return ENOSYS;
142+
#elif defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) || (defined(__ANDROID__) && __ANDROID_API__ >= 34) || defined(__musl__)
143+
// Pre-standard posix_spawn_file_actions_addchdir_np version available in:
144+
// - Solaris 11.3 (October 2015)
113145
diff --git a/swiftpm/Utilities/bootstrap b/swiftpm/Utilities/bootstrap
114146
index 156bf002a..d891da556 100755
115147
--- a/swiftpm/Utilities/bootstrap

swift-android-trunk-libdispatch.patch

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,3 @@
1-
From: Marc Prud'hommeaux <[email protected]>
2-
Date: Wed, 7 May 2025 10:24:19 -0400
3-
4-
diff --git a/llbuild/lib/Basic/Subprocess.cpp b/llbuild/lib/Basic/Subprocess.cpp
5-
index bf2fd4d1..8d4ee3de 100644
6-
--- a/llbuild/lib/Basic/Subprocess.cpp
7-
+++ b/llbuild/lib/Basic/Subprocess.cpp
8-
@@ -79,9 +79,12 @@ int pthread_fchdir_np(int fd)
9-
// Implementation mostly copied from _CFPosixSpawnFileActionsChdir in swift-corelibs-foundation
10-
static int posix_spawn_file_actions_addchdir_polyfill(posix_spawn_file_actions_t * __restrict file_actions,
11-
const char * __restrict path) {
12-
-#if defined(__GLIBC__) && !__GLIBC_PREREQ(2, 29)
13-
+#if (defined(__GLIBC__) && !__GLIBC_PREREQ(2, 29)) || (defined(__OpenBSD__)) || (defined(__ANDROID__) && __ANDROID_API__ < 34)
14-
// Glibc versions prior to 2.29 don't support posix_spawn_file_actions_addchdir_np, impacting:
15-
// - Amazon Linux 2 (EoL mid-2025)
16-
+ // Currently missing as of:
17-
+ // - OpenBSD 7.5 (April 2024)
18-
+ // - Android <= 14
19-
return ENOSYS;
20-
#elif defined(__APPLE__) && defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500
21-
// Conditionally available on macOS if building with a deployment target older than 10.15
22-
@@ -89,10 +92,6 @@ static int posix_spawn_file_actions_addchdir_polyfill(posix_spawn_file_actions_t
23-
return posix_spawn_file_actions_addchdir_np(file_actions, path);
24-
}
25-
return ENOSYS;
26-
-#elif defined(__OpenBSD__)
27-
- // Currently missing as of:
28-
- // - OpenBSD 7.5 (April 2024)
29-
- return ENOSYS;
30-
#elif defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) || (defined(__ANDROID__) && __ANDROID_API__ >= 34) || defined(__musl__)
31-
// Pre-standard posix_spawn_file_actions_addchdir_np version available in:
32-
// - Solaris 11.3 (October 2015)
331
diff --git a/swift-corelibs-libdispatch/src/swift/CMakeLists.txt b/swift-corelibs-libdispatch/src/swift/CMakeLists.txt
342
index 38bef37..d0ddf98 100644
353
--- a/swift-corelibs-libdispatch/src/swift/CMakeLists.txt

0 commit comments

Comments
 (0)