Skip to content

[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

Merged
merged 4 commits into from
Mar 22, 2016

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Mar 21, 2016

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 and stdlib/public/Glibc into single
stdlib/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:

IMO, 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:

  • Decide to unify them or not.
  • Decide the naming of the directory.
  • Test pull request on Swift continuous integration.

add_swift_library(${swift_platform_name} IS_SDK_OVERLAY
${swift_platform_sources}
${swift_platform_flags})

Copy link
Member Author

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.

@rintaro rintaro changed the title [WIP] [stdlib] Unified code base of Darwin and Glibc [RFC] [stdlib] Unified code base of Darwin and Glibc Mar 21, 2016
@rintaro rintaro force-pushed the merge-darwin-glibc branch 6 times, most recently from 3ea9a42 to 7be1075 Compare March 22, 2016 02:55
${swift_platform_sources}
${swift_platform_flags})

set(glibc_modulemap_targat_list)
Copy link
Contributor

Choose a reason for hiding this comment

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

Unused variable?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops typo, will fix.

@gribozavr
Copy link
Contributor

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.

@rintaro rintaro force-pushed the merge-darwin-glibc branch from 7be1075 to c692ac3 Compare March 22, 2016 08:17
@rintaro
Copy link
Member Author

rintaro commented Mar 22, 2016

@gribozavr Thanks for the review!
Rebased on 1e4f710 (Merge pull request #1724 from compnerd/correct-linkage).
Fixed typo in CMakeLists.txt.
Tested with build-script -RT (Mac, Linux), and build-script --preset buildbot_linux (Linux)

@gribozavr
Copy link
Contributor

@swift-ci Please test

@gribozavr
Copy link
Contributor

@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}")
Copy link
Member Author

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

@rintaro rintaro force-pushed the merge-darwin-glibc branch from c692ac3 to 91108b4 Compare March 22, 2016 15:52
@gribozavr
Copy link
Contributor

@swift-ci Please test

@rintaro rintaro force-pushed the merge-darwin-glibc branch from 58361b0 to 91108b4 Compare March 22, 2016 18:00
gribozavr added a commit that referenced this pull request Mar 22, 2016
[RFC] [stdlib] Unified code base of Darwin and Glibc
@gribozavr gribozavr merged commit d6ff94b into swiftlang:master Mar 22, 2016
@rintaro
Copy link
Member Author

rintaro commented Mar 22, 2016

Thanks!

@gribozavr
Copy link
Contributor

@rintaro Thank you for removing all that code duplication!

@rintaro rintaro deleted the merge-darwin-glibc branch March 23, 2016 07:46
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.

2 participants