swift
FreeBSD: Link C++ runtimes when Cxx interop is enabled
#82355
Merged

FreeBSD: Link C++ runtimes when Cxx interop is enabled #82355

etcwilde
etcwilde61 days ago👍 1

This patch gets all of the C++ interop tests passing on FreeBSD. There were two bugs.

First, the Swift tests use the old Swift driver, which only used the experimental C++ interop flag to determine whether or not to use clang++ or clang. Changing the legacy driver to align more closely with the behavior of the Swift driver:

      var cxxCompatEnabled = parsedOptions.hasArgument(.enableExperimentalCxxInterop)
      if let cxxInteropMode = parsedOptions.getLastArgument(.cxxInteroperabilityMode) {
        if cxxInteropMode.asSingle != "off" {
          cxxCompatEnabled = true
        }
      }
      // ...
      let clangTool: Tool = cxxCompatEnabled ? .clangxx : .clang
      // ...

Second, there were several tests that didn't pass the flag to the driver, but to the frontend, so that didn't fix all of the tests. The tests passing it to the frontend are relying on the autolink mechanism to automatically pull in a C++ runtime and an overlay. A separate patch adds FreeBSD to the list of OS's to automatically link the C++ runtime when C++ interop is enabled.

Third, this isn't fixing bugs, but just enabling a handful of tests that are passing but were marked unsupported.

etcwilde Use C++ driver when C++ interop is enabled
33767856
etcwilde FreeBSD: Autolink C++ runtime
91aa7b88
etcwilde FreeBSD: Enable a few more C++ interop tests
3a48d6e9
etcwilde etcwilde added FreeBSD
etcwilde etcwilde requested a review from zoecarver zoecarver 61 days ago
etcwilde etcwilde requested a review from egorzhdan egorzhdan 61 days ago
etcwilde etcwilde requested a review from Xazax-hun Xazax-hun 61 days ago
etcwilde etcwilde requested a review from j-hui j-hui 61 days ago
etcwilde etcwilde requested a review from fahadnayyar fahadnayyar 61 days ago
etcwilde etcwilde requested a review from susmonteiro susmonteiro 61 days ago
etcwilde etcwilde requested a review from hnrklssn hnrklssn 61 days ago
etcwilde etcwilde requested a review from artemcm artemcm 61 days ago
etcwilde etcwilde requested a review from tshortli tshortli 61 days ago
etcwilde etcwilde requested a review from hborla hborla 61 days ago
etcwilde etcwilde requested a review from slavapestov slavapestov 61 days ago
etcwilde etcwilde requested a review from xedin xedin 61 days ago
etcwilde
etcwilde61 days ago

@swift-ci please test

etcwilde etcwilde added c++ interop
Xazax-hun
Xazax-hun approved these changes on 2025-06-19
Xazax-hun61 days ago

LG, thanks!

egorzhdan
egorzhdan approved these changes on 2025-06-19
etcwilde
etcwilde57 days ago

@swift-ci please test Linux

egorzhdan
egorzhdan approved these changes on 2025-06-23
artemcm
artemcm approved these changes on 2025-06-23
etcwilde etcwilde merged 7f3fdb32 into main 56 days ago

Login to write a write a comment.

Login via GitHub

Assignees
No one assigned
Labels
Milestone