Skip to content

Glibc cross-compilation errors with .cxx interop enabled with a 6.2 snapshot Swift SDK #9060

@xtremekforever

Description

@xtremekforever

Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?

  • Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands, swift build, swift test, swift package etc.

Description

I have a simple swift-hello package with just the following content:

import Glibc

@main
struct swift_hello {
    static func main() {
        print("Hello, world!")
    }
}

If I try to cross-compile it with a Swift SDK generated using a 6.2 snapshot swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a with the -Xswiftc -cxx-interoperability-mode=default flag, I get the following error:

Building for debugging...
error: emit-module command failed with exit code 1 (use -v to see invocation)
~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/lib/swift/linux/Glibc.swiftmodule/x86_64-unknown-linux-gnu.private.swiftinterface:92:44: error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 90 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt, _ ptr: Swift.UnsafeMutableRawPointer) -> Swift.CInt
 91 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt) -> Swift.CInt
 92 | public typealias sighandler_t = SwiftGlibc.__sighandler_t
    |                                            `- error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 93 | #if compiler(>=5.3) && $NonescapableTypes
 94 | public var SIG_DFL: Glibc.sighandler_t? {

~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/include/signal.h:72:16: note: type alias declared here
 70 |
 71 | /* Type of a signal handler.  */
 72 | typedef void (*__sighandler_t) (int);
    |                `- note: type alias declared here
 73 |
 74 | /* The X/Open definition of `signal' specifies the SVID semantic.  Use

~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/lib/swift/linux/Glibc.swiftmodule/x86_64-unknown-linux-gnu.private.swiftinterface:1:1: error: failed to build module 'Glibc' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug
  1 | // swift-interface-format-version: 1.0
    | `- error: failed to build module 'Glibc' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug
  2 | // swift-compiler-version: Swift version 6.2-dev effective-5.10 (LLVM bc9310bd0a6ef8e, Swift a57432aae96a36b)
  3 | // swift-module-flags: -target x86_64-unknown-linux-gnu -disable-objc-interop -autolink-force-load -enable-library-evolution -module-link-name swiftGlibc -static -swift-version 5 -O -library-level api -enforce-exclusivity=unchecked -disable-objc-interop -target-min-inlining-version min -enable-experimental-feature NoncopyableGenerics2 -enable-experimental-feature SuppressedAssociatedTypes -enable-experimental-feature SE427NoInferenceOnExtension -enable-experimental-feature NonescapableTypes -enable-experimental-feature LifetimeDependence -enable-experimental-feature InoutLifetimeDependence -enable-experimental-feature LifetimeDependenceMutableAccessors -enable-upcoming-feature MemberImportVisibility -module-name Glibc

~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/lib/swift/linux/Glibc.swiftmodule/x86_64-unknown-linux-gnu.private.swiftinterface:92:44: error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 90 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt, _ ptr: Swift.UnsafeMutableRawPointer) -> Swift.CInt
 91 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt) -> Swift.CInt
 92 | public typealias sighandler_t = SwiftGlibc.__sighandler_t
    |                                            `- error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 93 | #if compiler(>=5.3) && $NonescapableTypes
 94 | public var SIG_DFL: Glibc.sighandler_t? {

~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/include/signal.h: 0:
~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/lib/swift/linux/Glibc.swiftmodule/x86_64-unknown-linux-gnu.private.swiftinterface:92:44: error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 90 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt, _ ptr: Swift.UnsafeMutableRawPointer) -> Swift.CInt
 91 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt) -> Swift.CInt
 92 | public typealias sighandler_t = SwiftGlibc.__sighandler_t
    |                                            `- error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 93 | #if compiler(>=5.3) && $NonescapableTypes
 94 | public var SIG_DFL: Glibc.sighandler_t? {

~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/include/signal.h:72:16: note: type alias declared here
 70 |
 71 | /* Type of a signal handler.  */
 72 | typedef void (*__sighandler_t) (int);
    |                `- note: type alias declared here
 73 |
 74 | /* The X/Open definition of `signal' specifies the SVID semantic.  Use

~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/lib/swift/linux/Synchronization.swiftmodule/x86_64-unknown-linux-gnu.private.swiftinterface: 0:
~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/lib/swift/linux/Glibc.swiftmodule/x86_64-unknown-linux-gnu.private.swiftinterface:92:44: error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 90 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt, _ ptr: Swift.UnsafeMutableRawPointer) -> Swift.CInt
 91 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt) -> Swift.CInt
 92 | public typealias sighandler_t = SwiftGlibc.__sighandler_t
    |                                            `- error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 93 | #if compiler(>=5.3) && $NonescapableTypes
 94 | public var SIG_DFL: Glibc.sighandler_t? {

~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/include/signal.h: 0:
~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/lib/swift/linux/Glibc.swiftmodule/x86_64-unknown-linux-gnu.private.swiftinterface:92:44: error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 90 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt, _ ptr: Swift.UnsafeMutableRawPointer) -> Swift.CInt
 91 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt) -> Swift.CInt
 92 | public typealias sighandler_t = SwiftGlibc.__sighandler_t
    |                                            `- error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 93 | #if compiler(>=5.3) && $NonescapableTypes
 94 | public var SIG_DFL: Glibc.sighandler_t? {

~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/include/signal.h: 0:
~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/lib/swift/linux/Synchronization.swiftmodule/x86_64-unknown-linux-gnu.private.swiftinterface: 0:
~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/lib/swift/linux/Glibc.swiftmodule/x86_64-unknown-linux-gnu.private.swiftinterface:92:44: error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 90 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt, _ ptr: Swift.UnsafeMutableRawPointer) -> Swift.CInt
 91 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt) -> Swift.CInt
 92 | public typealias sighandler_t = SwiftGlibc.__sighandler_t
    |                                            `- error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 93 | #if compiler(>=5.3) && $NonescapableTypes
 94 | public var SIG_DFL: Glibc.sighandler_t? {

~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SN~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/lib/swift/linux/Glibc.swiftmodule/x86_64-unknown-linux-gnu.private.swiftinterface:92:44: error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 90 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt, _ ptr: Swift.UnsafeMutableRawPointer) -> Swift.CInt
 91 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt) -> Swift.CInt
 92 | public typealias sighandler_t = SwiftGlibc.__sighandler_t
    |                                            `- error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 93 | #if compiler(>=5.3) && $NonescapableTypes
 94 | public var SIG_DFL: Glibc.sighandler_t? {

~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/include/signal.h:72:16: note: type alias declared here
 70 |
 71 | /* Type of a signal handler.  */
 72 | typedef void (*__sighandler_t) (int);
    |                `- note: type alias declared here
 73 |
 74 | /* The X/Open definition of `signal' specifies the SVID semantic.  Use

~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/lib/swift/linux/Glibc.swiftmodule/x86_64-unknown-linux-gnu.private.swiftinterface:1:1: error: failed to build module 'Glibc' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug
  1 | // swift-interface-format-version: 1.0
    | `- error: failed to build module 'Glibc' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug
  2 | // swift-compiler-version: Swift version 6.2-dev effective-5.10 (LLVM bc9310bd0a6ef8e, Swift a57432aae96a36b)
  3 | // swift-module-flags: -target x86_64-unknown-linux-gnu -disable-objc-interop -autolink-force-load -enable-library-evolution -module-link-name swiftGlibc -static -swift-version 5 -O -library-level api -enforce-exclusivity=unchecked -disable-objc-interop -target-min-inlining-version min -enable-experimental-feature NoncopyableGenerics2 -enable-experimental-feature SuppressedAssociatedTypes -enable-experimental-feature SE427NoInferenceOnExtension -enable-experimental-feature NonescapableTypes -enable-experimental-feature LifetimeDependence -enable-experimental-feature InoutLifetimeDependence -enable-experimental-feature LifetimeDependenceMutableAccessors -enable-upcoming-feature MemberImportVisibility -module-name Glibc

~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/lib/swift/linux/Glibc.swiftmodule/x86_64-unknown-linux-gnu.private.swiftinterface:92:44: error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 90 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt, _ ptr: Swift.UnsafeMutableRawPointer) -> Swift.CInt
 91 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt) -> Swift.CInt
 92 | public typealias sighandler_t = SwiftGlibc.__sighandler_t
    |                                            `- error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 93 | #if compiler(>=5.3) && $NonescapableTypes
 94 | public var SIG_DFL: Glibc.sighandler_t? {

~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/include/signal.h: 0:
~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/lib/swift/linux/Glibc.swiftmodule/x86_64-unknown-linux-gnu.private.swiftinterface:92:44: error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 90 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt, _ ptr: Swift.UnsafeMutableRawPointer) -> Swift.CInt
 91 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt) -> Swift.CInt
 92 | public typealias sighandler_t = SwiftGlibc.__sighandler_t
    |                                            `- error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 93 | #if compiler(>=5.3) && $NonescapableTypes
 94 | public var SIG_DFL: Glibc.sighandler_t? {

~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/include/signal.h:72:16: note: type alias declared here
 70 |
 71 | /* Type of a signal handler.  */
 72 | typedef void (*__sighandler_t) (int);
    |                `- note: type alias declared here
 73 |
 74 | /* The X/Open definition of `signal' specifies the SVID semantic.  Use

~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/lib/swift/linux/Synchronization.swiftmodule/x86_64-unknown-linux-gnu.private.swiftinterface: 0:
~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/lib/swift/linux/Glibc.swiftmodule/x86_64-unknown-linux-gnu.private.swiftinterface:92:44: error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 90 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt, _ ptr: Swift.UnsafeMutableRawPointer) -> Swift.CInt
 91 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt) -> Swift.CInt
 92 | public typealias sighandler_t = SwiftGlibc.__sighandler_t
    |                                            `- error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 93 | #if compiler(>=5.3) && $NonescapableTypes
 94 | public var SIG_DFL: Glibc.sighandler_t? {

~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/include/signal.h: 0:
~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/lib/swift/linux/Glibc.swiftmodule/x86_64-unknown-linux-gnu.private.swiftinterface:92:44: error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 90 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt, _ ptr: Swift.UnsafeMutableRawPointer) -> Swift.CInt
 91 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt) -> Swift.CInt
 92 | public typealias sighandler_t = SwiftGlibc.__sighandler_t
    |                                            `- error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 93 | #if compiler(>=5.3) && $NonescapableTypes
 94 | public var SIG_DFL: Glibc.sighandler_t? {

~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/include/signal.h: 0:
~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/lib/swift/linux/Synchronization.swiftmodule/x86_64-unknown-linux-gnu.private.swiftinterface: 0:
~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/lib/swift/linux/Glibc.swiftmodule/x86_64-unknown-linux-gnu.private.swiftinterface:92:44: error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 90 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt, _ ptr: Swift.UnsafeMutableRawPointer) -> Swift.CInt
 91 | public func ioctl(_ fd: Swift.CInt, _ request: Swift.UInt) -> Swift.CInt
 92 | public typealias sighandler_t = SwiftGlibc.__sighandler_t
    |                                            `- error: cannot use type alias '__sighandler_t' here; C++ types from imported module 'SwiftGlibc' do not support library evolution
 93 | #if compiler(>=5.3) && $NonescapableTypes
 94 | public var SIG_DFL: Glibc.sighandler_t? {

~/.swiftpm/swift-sdks/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64.artifactbundle/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_x86_64/x86_64-unknown-linux-gnu/debian-bookworm.sdk/usr/include/signal.h: 0:

This happens with any 6.2 Swift SDK as long as the package imports Glibc. Some examples of commands that fail with the exact same error:

$ swift build --swift-sdk 6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_ubuntu_jammy_x86_64 -Xswiftc -cxx-interoperability-mode=default
$ swift build --swift-sdk 6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_aarch64 -Xswiftc -cxx-interoperability-mode=default
$ swift build --swift-sdk 6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_armv7 -Xswiftc -cxx-interoperability-mode=default

If I remove the import Glibc line it compiles. If I remove the -Xswiftc -cxx-interoperability-mode=default flag to disable .cxx interop it also compiles.

Expected behavior

I expect this to compile properly as it did with Swift 5.10, 6.0, 6.1, etc...

Actual behavior

Cross-compilation fails under the 6.2 snapshot due to the errors shown in the description.

Steps to reproduce

  1. Create a Swift SDK using the 6.2 snapshot tag: swift run swift-sdk-generator make-linux-sdk --swift-branch swift-6.2-branch --swift-version 6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a --target aarch64-unknown-linux-gnu --distribution-name debian --distribution-version 12
  2. Install the Swift SDK: swift sdk install Bundles/6.2-DEVELOPMENT-SNAPSHOT-2025-08-21-a_debian_bookworm_aarch64.artifactbundle
  3. Compile using the Swift SDK (see commands above).

Swift Package Manager version/commit hash

No response

Swift & OS version (output of swift --version ; uname -a)

Swift version 6.2-dev (LLVM bc9310bd0a6ef8e, Swift a57432aae96a36b)
Target: x86_64-unknown-linux-gnu
Build config: +assertions
Linux ella 6.14.0-27-generic #27~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 17:38:49 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions