-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[RFC] [stdlib] Unified code base of Darwin and Glibc #1757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
add_swift_library(${swift_platform_name} IS_SDK_OVERLAY | ||
${swift_platform_sources} | ||
${swift_platform_flags}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed INSTALL_IN_COMPONENT stdlib-experimental
for Glibc because it's eventually reset to sdk-overlay
.
3ea9a42
to
7be1075
Compare
${swift_platform_sources} | ||
${swift_platform_flags}) | ||
|
||
set(glibc_modulemap_targat_list) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops typo, will fix.
Generally the approach looks good to me. This is a great improvement for Linux and FreeBSD overlays! Could you resolve the conflicts? Please make sure to preserve changes from #1724. |
7be1075
to
c692ac3
Compare
@gribozavr Thanks for the review! |
@swift-ci Please test |
@rintaro Seems like the buildbot found some issues on Linux... |
# This will break if cross-compiling from a distro that uses the | ||
# architecture as part of the path to a distro that does not. | ||
set(GLIBC_ARCH_INCLUDE_PATH | ||
"${GLIBC_INCLUDE_PATH}/${CMAKE_LIBRARY_ARCHTECTURE}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awful typo. CMAKE_LIBRARY_ARCHTECTURE
-> CMAKE_LIBRARY_ARCHITECTURE
c692ac3
to
91108b4
Compare
@swift-ci Please test |
58361b0
to
91108b4
Compare
[RFC] [stdlib] Unified code base of Darwin and Glibc
Thanks! |
@rintaro Thank you for removing all that code duplication! |
What's in this pull request?
In this PR, at least for now, I don't intend to implement @modocache's proposal: Unify "import Darwin/Glibc" to simply "Libc",
but just to make code management easier for future enhancement. No API changes.
Unified
stdlib/public/SDK/Darwin
andstdlib/public/Glibc
into singlestdlib/public/Platform
directory, and share the code where possible.The naming of the directory name
Platform
is still debatable. (System
,Host
,Libc
, ...)Using this, I implemented
tgmath
in Glibc module. (included in this PR)Actually, the original motivation is to implement tgmath.
We have several options to do that:
Darwin/tgmath.swift.gyb
toGlibc/tgmath.swift.gyb
. master...rintaro:linux-tgmathtgmath.swift.gyb
tchagnon@742eff3IMO, the last option is the best for future enhancement.
Please tell me if we need discussion on swift-dev ML.
Resolved bug number: (SR-638)
Before merging this pull request to apple/swift repository: