Skip to content

Commit 79c22ad

Browse files
authored
FreeBSD: Gate GNU-only API (#1183)
The FreeBSD builds are currently using the GlibC modulemap to import the C runtimes. FreeBSD does not have `gnu_get_libc_version` resulting in build failures. The use of this API was introduced in #1147
1 parent db76ea7 commit 79c22ad

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/Testing/ExitTests/SpawnProcess.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func spawnExecutable(
137137
// standardized in POSIX.1-2024 (see https://pubs.opengroup.org/onlinepubs/9799919799/functions/posix_spawn_file_actions_adddup2.html
138138
// and https://www.austingroupbugs.net/view.php?id=411).
139139
_ = posix_spawn_file_actions_adddup2(fileActions, fd, fd)
140-
#if canImport(Glibc)
140+
#if canImport(Glibc) && !os(FreeBSD) && !os(OpenBSD)
141141
if _slowPath(glibcVersion.major < 2 || (glibcVersion.major == 2 && glibcVersion.minor < 29)) {
142142
// This system is using an older version of glibc that does not
143143
// implement FD_CLOEXEC clearing in posix_spawn_file_actions_adddup2(),

Sources/Testing/Support/Versions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ let swiftStandardLibraryVersion: String = {
153153
return "unknown"
154154
}()
155155

156-
#if canImport(Glibc)
156+
#if canImport(Glibc) && !os(FreeBSD) && !os(OpenBSD)
157157
/// The (runtime, not compile-time) version of glibc in use on this system.
158158
///
159159
/// This value is not part of the public interface of the testing library.

0 commit comments

Comments
 (0)