Skip to content

Conversation

etcwilde
Copy link
Member

@etcwilde etcwilde commented Oct 7, 2025

Adding a Glibc overlay for Linux. As part of this, I bumped the stdlib version override to only apply to Apple platforms since that's the only place where those have meaning. This way we don't see warnings about not recognizing the other platforms.

Platform availability is an Apple concept because Swift is shipped as part of the OS. It doesn't make sense to check or to warn on other platforms. Only checking and setting it for Apple platforms.
@etcwilde
Copy link
Member Author

etcwilde commented Oct 7, 2025

@swift-ci please smoke test

@etcwilde etcwilde force-pushed the ewilde/runtimes-linux-glibc-overlay branch 2 times, most recently from ca572b0 to 5369578 Compare October 7, 2025 18:50
@etcwilde
Copy link
Member Author

etcwilde commented Oct 7, 2025

@swift-ci please smoke test

Explicit module builds crash the compiler when building the glibc overlay library. The crash occurs in the Swift driver dependency scanner. It appears to be related to vfs overlays, modulemaps, injected header files, and explicit module builds. This is odd though because the Android builds also have this combination, but work.
Adding a new glibc overlay for Linux builds. We will eventually need one for Musl, and if someone really wants to, LLVM and cosmopolitan libcs are also out there.
@etcwilde etcwilde force-pushed the ewilde/runtimes-linux-glibc-overlay branch from 5369578 to 59ade4c Compare October 7, 2025 19:45
@etcwilde
Copy link
Member Author

etcwilde commented Oct 7, 2025

@swift-ci please smoke test

Swift_MODULE_NAME Glibc)

target_compile_options(swiftGlibc PRIVATE
"SHELL:-Xcc -fno-omit-frame-pointer"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we ensure these flags are only set when compiling for Swift? Or are we sure we will not be adding other non Swift files to this target?

"SHELL:-Xfrontend -empty-abi-descriptor"
"SHELL:-Xfrontend -prespecialize-generic-metadata"
"SHELL:-Xfrontend -require-explicit-availability=ignore"
"SHELL:-library-level api")
Copy link
Contributor

Choose a reason for hiding this comment

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

Unless I'm missing context, I think we want to install this library

Suggested change
"SHELL:-library-level api")
"SHELL:-library-level api")
install(TARGETS swiftGlibc
EXPORT SwiftOverlayTargets
ARCHIVE DESTINATION "${SwiftOverlay_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${SwiftOverlay_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
emit_swift_interface(swiftGlibc)
install_swift_interface(swiftGlibc)
embed_manifest(swiftGlibc)
@etcwilde
Copy link
Member Author

etcwilde commented Oct 8, 2025

@swift-ci please smoke test Linux Platform

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants