Skip to content

[cmake][shared-build] Add build dependency on libc++ from stdlib#90361

Closed
Teemperor wants to merge 1 commit into
swiftlang:mainfrom
Teemperor:AddRuntimesDependency
Closed

[cmake][shared-build] Add build dependency on libc++ from stdlib#90361
Teemperor wants to merge 1 commit into
swiftlang:mainfrom
Teemperor:AddRuntimesDependency

Conversation

@Teemperor

Copy link
Copy Markdown
Contributor

When building in a shared build folder, the libc++ module needs to be available for building the C++ overlay in Swift. This patch just adds a dependency on runtimes (which builds libc++). When building with build-script in different folders, the target doesn't exist and this patch won't change existing behavior.

When building in a shared build folder, the libc++ module needs to be
available for building the C++ overlay in Swift. This patch just adds a
dependency on runtimes (which builds libc++). When building with
build-script in different folders, the target doesn't exist and this
patch won't change existing behavior.
@Teemperor

Copy link
Copy Markdown
Contributor Author

@swift-ci test

@Teemperor

Copy link
Copy Markdown
Contributor Author

Windows is unrelated, and some source kit tests failed that also seems unrelated.

@Teemperor

Copy link
Copy Markdown
Contributor Author

@swift-ci test macOS

@Teemperor

Copy link
Copy Markdown
Contributor Author

@swift-ci test windows

INSTALL_BINARY_SWIFTMODULE NON_DARWIN_ONLY
INSTALL_WITH_SHARED
DEPENDS libstdcxx-modulemap libcxxshim_modulemap CxxStdlib-apinotes)
DEPENDS libstdcxx-modulemap libcxxshim_modulemap CxxStdlib-apinotes ${_cxxstdlib_extra_deps})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was told that stdlib/ CMake changes should be accompanied by a Runtimes/ change also, perhaps @edymtt can counsel you on that.

@Teemperor

Copy link
Copy Markdown
Contributor Author

@swift-ci test macOS

@egorzhdan egorzhdan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look right – the CxxStdlib overlay is built against the libc++ from the system/SDK, not the just-built libc++. When building the Swift toolchain on macOS, the two versions of libc++ might be substantially different.

What are you trying to achieve?

@Teemperor

Copy link
Copy Markdown
Contributor Author

@egorzhdan To give some context, this PR is part of a series that allows building LLVM/Swift/LLDB in one build folder (and without needing build-script). It seems our CMake code builds by default against the just-built libc++ and this was just declaring this dependency. If this really needs to build against the host libc++ then this fix is indeed wrong.

@Teemperor Teemperor closed this Jul 7, 2026
@egorzhdan

Copy link
Copy Markdown
Contributor

Got it, great to see this work happening!

With the current build, I'm pretty sure we use the libc++ from the SDK. Happy to take a closer look into this offline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants