Skip to content

Commit 0f1000b

Browse files
committed
FreeBSD cxx stdlib and tests fixes
1 parent 709c275 commit 0f1000b

11 files changed

+21
-7
lines changed

stdlib/public/Cxx/std/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ add_swift_target_library(swiftCxxStdlib STATIC NO_LINK_NAME IS_STDLIB IS_SWIFT_O
7575
DEPLOYMENT_VERSION_XROS ${COMPATIBILITY_MINIMUM_DEPLOYMENT_VERSION_XROS}
7676

7777
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
78-
TARGET_SDKS ALL_APPLE_PLATFORMS LINUX WINDOWS ANDROID
78+
TARGET_SDKS ALL_APPLE_PLATFORMS LINUX WINDOWS ANDROID FREEBSD
7979
MACCATALYST_BUILD_FLAVOR zippered
8080
INSTALL_IN_COMPONENT compiler
8181
INSTALL_WITH_SHARED

stdlib/public/Platform/SwiftGlibc.h.gyb

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ headers = [
5757
'nl_types.h',
5858
'poll.h',
5959
'pthread.h',
60+
'pthread_np.h',
6061
'pwd.h',
6162
'regex.h',
6263
'sched.h',

stdlib/public/runtime/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ set(swift_runtime_backtracing_sources
9393
Backtrace.cpp
9494
BacktraceUtils.cpp
9595
CrashHandlerMacOS.cpp
96-
CrashHandlerLinux.cpp)
96+
CrashHandlerLinux.cpp
97+
)
9798

9899
# Acknowledge that the following sources are known.
99100
set(LLVM_OPTIONAL_SOURCES

test/Concurrency/Runtime/async_task_executor_and_serial_executor_both_executor.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88

99
// TODO: Need to find out how to combine %env- and %target-run and %import-libdispatch reliably.
1010
// UNSUPPORTED: OS=linux-gnu
11+
// UNSUPPORTED: OS=freebsd
1112

1213
// REQUIRES: concurrency
1314
// REQUIRES: executable_test
1415
// REQUIRES: libdispatch
15-
//
16+
//
1617
// REQUIRES: concurrency_runtime
1718
// UNSUPPORTED: back_deployment_runtime
1819

test/Concurrency/Runtime/custom_executors_complex_equality_crash.swift

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
// TODO: Need to find out how to combine %env- and %target-run and %import-libdispatch reliably.
1010
// UNSUPPORTED: OS=linux-gnu
11+
// UNSUPPORTED: OS=freebsd
1112

1213
// REQUIRES: concurrency
1314
// REQUIRES: executable_test

test/Distributed/Runtime/distributed_actor_protocol_call_resilient_lib.swift

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
// Locating the built libraries failed on Linux (construction of test case),
7272
// but we primarily care about macOS in this test
7373
// UNSUPPORTED: OS=linux-gnu
74+
// UNSUPPORTED: OS=freebsd
7475

7576
// UNSUPPORTED: use_os_stdlib
7677
// UNSUPPORTED: back_deployment_runtime

test/Interop/Cxx/stdlib/fake-toolchain-module-interface.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-ide-test -print-module -module-to-print=FakeToolchain -tools-directory %S/Inputs/fake-toolchain/bin -source-filename=x -enable-experimental-cxx-interop -Xcc -stdlib=libc++ | %FileCheck %s
1+
// RUN: %target-swift-ide-test -print-module -module-to-print=FakeToolchain -tools-directory %S/Inputs/fake-toolchain/bin -source-filename=x -enable-experimental-cxx-interop -Xcc -stdlib=libc++ -Xcc -I%S/Inputs/fake-toolchain/include/c++/v1 | %FileCheck %s
22

33
// Clang driver on Windows doesn't support -stdlib=libc++
44
// XFAIL: OS=windows-msvc

test/Interop/Cxx/stdlib/use-std-optional.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ StdOptionalTestSuite.test("pointee") {
1616
let pointee = nonNilOpt.pointee
1717
expectEqual(123, pointee)
1818

19-
#if !os(Linux) // crashes on Ubuntu 18.04 (rdar://113414160)
19+
#if !os(Linux) && !os(FreeBSD) // crashes on Ubuntu 18.04 (rdar://113414160)
2020
var modifiedOpt = getNilOptional()
2121
modifiedOpt.pointee = 777
2222
expectEqual(777, modifiedOpt.pointee)

test/stdlib/DispatchTypes.swift

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -typecheck %s
1+
// RUN: %target-swift-frontend -typecheck %s %import-libdispatch
22

33
// REQUIRES: libdispatch
44
// UNSUPPORTED: OS=linux-gnu
@@ -27,14 +27,22 @@ if #available(OSX 10.10, iOS 8.0, *) {
2727
// dispatch/source.h
2828
_ = DispatchSource.makeUserDataAddSource()
2929
_ = DispatchSource.makeUserDataOrSource()
30+
#if !os(FreeBSD)
3031
_ = DispatchSource.makeMachSendSource(port: mach_port_t(0), eventMask: [])
3132
_ = DispatchSource.makeMachReceiveSource(port: mach_port_t(0))
3233
_ = DispatchSource.makeMemoryPressureSource(eventMask: [])
34+
#endif
3335
_ = DispatchSource.makeProcessSource(identifier: 0, eventMask: [])
3436
_ = DispatchSource.makeReadSource(fileDescriptor: 0)
37+
#if os(FreeBSD)
38+
_ = DispatchSource.makeSignalSource(signal: 2)
39+
#else
3540
_ = DispatchSource.makeSignalSource(signal: SIGINT)
41+
#endif
3642
_ = DispatchSource.makeTimerSource()
43+
#if !os(FreeBSD)
3744
_ = DispatchSource.makeFileSystemObjectSource(fileDescriptor: 0, eventMask: [])
45+
#endif
3846
_ = DispatchSource.makeWriteSource(fileDescriptor: 0)
3947

4048
// dispatch/time.h

test/stdlib/POSIX.swift

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// REQUIRES: executable_test
33
// UNSUPPORTED: OS=windows-msvc
44
// UNSUPPORTED: OS=wasi
5+
// UNSUPPORTED: OS=freebsd
56

67
import StdlibUnittest
78
import SwiftPrivateLibcExtras

test/stdlib/simd_diagnostics.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %target-typecheck-verify-swift
22

33
// FIXME: No simd module on linux rdar://problem/20795411
4-
// XFAIL: OS=linux-gnu, OS=windows-msvc, OS=openbsd, OS=linux-android, OS=linux-androideabi
4+
// XFAIL: OS=linux-gnu, OS=windows-msvc, OS=openbsd, OS=linux-android, OS=linux-androideabi, OS=freebsd
55
// XFAIL: OS=wasi
66

77
import simd

0 commit comments

Comments
 (0)