FreeBSD cxx stdlib and tests fixes

This commit is contained in:
Michael Chiu
2025-01-26 04:20:58 -05:00
parent 03463ea0cc
commit 26dd5c3787
11 changed files with 21 additions and 7 deletions

View File

@@ -77,7 +77,7 @@ add_swift_target_library(swiftCxxStdlib STATIC NO_LINK_NAME IS_STDLIB IS_SWIFT_O
DEPLOYMENT_VERSION_XROS ${COMPATIBILITY_MINIMUM_DEPLOYMENT_VERSION_XROS}
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
TARGET_SDKS ALL_APPLE_PLATFORMS LINUX WINDOWS ANDROID
TARGET_SDKS ALL_APPLE_PLATFORMS LINUX WINDOWS ANDROID FREEBSD
MACCATALYST_BUILD_FLAVOR zippered
INSTALL_IN_COMPONENT compiler
INSTALL_WITH_SHARED

View File

@@ -57,6 +57,7 @@ headers = [
'nl_types.h',
'poll.h',
'pthread.h',
'pthread_np.h',
'pwd.h',
'regex.h',
'sched.h',

View File

@@ -94,7 +94,8 @@ set(swift_runtime_backtracing_sources
Backtrace.cpp
BacktraceUtils.cpp
CrashHandlerMacOS.cpp
CrashHandlerLinux.cpp)
CrashHandlerLinux.cpp
)
# Acknowledge that the following sources are known.
set(LLVM_OPTIONAL_SOURCES

View File

@@ -8,11 +8,12 @@
// TODO: Need to find out how to combine %env- and %target-run and %import-libdispatch reliably.
// UNSUPPORTED: OS=linux-gnu
// UNSUPPORTED: OS=freebsd
// REQUIRES: concurrency
// REQUIRES: executable_test
// REQUIRES: libdispatch
//
//
// REQUIRES: concurrency_runtime
// UNSUPPORTED: back_deployment_runtime

View File

@@ -8,6 +8,7 @@
// TODO: Need to find out how to combine %env- and %target-run and %import-libdispatch reliably.
// UNSUPPORTED: OS=linux-gnu
// UNSUPPORTED: OS=freebsd
// REQUIRES: concurrency
// REQUIRES: executable_test

View File

@@ -71,6 +71,7 @@
// Locating the built libraries failed on Linux (construction of test case),
// but we primarily care about macOS in this test
// UNSUPPORTED: OS=linux-gnu
// UNSUPPORTED: OS=freebsd
// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: back_deployment_runtime

View File

@@ -1,4 +1,4 @@
// 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
// 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
// Clang driver on Windows doesn't support -stdlib=libc++
// XFAIL: OS=windows-msvc

View File

@@ -16,7 +16,7 @@ StdOptionalTestSuite.test("pointee") {
let pointee = nonNilOpt.pointee
expectEqual(123, pointee)
#if !os(Linux) // crashes on Ubuntu 18.04 (rdar://113414160)
#if !os(Linux) && !os(FreeBSD) // crashes on Ubuntu 18.04 (rdar://113414160)
var modifiedOpt = getNilOptional()
modifiedOpt.pointee = 777
expectEqual(777, modifiedOpt.pointee)

View File

@@ -1,4 +1,4 @@
// RUN: %target-swift-frontend -typecheck %s
// RUN: %target-swift-frontend -typecheck %s %import-libdispatch
// REQUIRES: libdispatch
// UNSUPPORTED: OS=linux-gnu
@@ -27,14 +27,22 @@ if #available(OSX 10.10, iOS 8.0, *) {
// dispatch/source.h
_ = DispatchSource.makeUserDataAddSource()
_ = DispatchSource.makeUserDataOrSource()
#if !os(FreeBSD)
_ = DispatchSource.makeMachSendSource(port: mach_port_t(0), eventMask: [])
_ = DispatchSource.makeMachReceiveSource(port: mach_port_t(0))
_ = DispatchSource.makeMemoryPressureSource(eventMask: [])
#endif
_ = DispatchSource.makeProcessSource(identifier: 0, eventMask: [])
_ = DispatchSource.makeReadSource(fileDescriptor: 0)
#if os(FreeBSD)
_ = DispatchSource.makeSignalSource(signal: 2)
#else
_ = DispatchSource.makeSignalSource(signal: SIGINT)
#endif
_ = DispatchSource.makeTimerSource()
#if !os(FreeBSD)
_ = DispatchSource.makeFileSystemObjectSource(fileDescriptor: 0, eventMask: [])
#endif
_ = DispatchSource.makeWriteSource(fileDescriptor: 0)
// dispatch/time.h

View File

@@ -2,6 +2,7 @@
// REQUIRES: executable_test
// UNSUPPORTED: OS=windows-msvc
// UNSUPPORTED: OS=wasi
// UNSUPPORTED: OS=freebsd
import StdlibUnittest
import SwiftPrivateLibcExtras

View File

@@ -1,7 +1,7 @@
// RUN: %target-typecheck-verify-swift
// FIXME: No simd module on linux rdar://problem/20795411
// XFAIL: OS=linux-gnu, OS=windows-msvc, OS=openbsd, OS=linux-android, OS=linux-androideabi
// XFAIL: OS=linux-gnu, OS=windows-msvc, OS=openbsd, OS=linux-android, OS=linux-androideabi, OS=freebsd
// XFAIL: OS=wasi
import simd