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
Porting to cygwin #1108
Porting to cygwin #1108
Conversation
I'll made more patches for stdlib/public/stubs/Stubs.cpp, stdlib/public/stubs/UnicodeNormalization.cpp, |
|
||
// On Cygwin, std::once_flag can not be used because it is larger than the | ||
// platform word. | ||
typedef unsigned long swift_once_t; |
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.
uintptr_t
might be a better fit?
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.
It seems other implementations (Linux, Cygwin internal.. ) didn't use a pointer type, so I chosen that.
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.
We don't want a pointer, we want a pointer-sized int.
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.
I misunderstand about uintptr_t. I'll change to it. Thank you.
@tinysun212 Thank you for your updates! I made more comments, please take a look. |
This is looking really good now, by the way! |
#if os(Windows) | ||
// If the return type of a C/C++ function is a structure, | ||
// the calling convension is different from caller's. | ||
// A wrapper function is introduced. |
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.
Can you change TwoWordPair::Return
in the runtime to be an __int128
on Win64 instead of exposing the C calling convention difference in Swift code?
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.
I'll try it.
I'm waiting reviews for correction. If there is nothing to correct, what should I do with this PR? |
ValueStream.imbue(std::locale::classic()); | ||
ValueStream << Value; | ||
std::string ValueString(ValueStream.str()); | ||
int i = ValueString.length(); |
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.
The variable should be declared as size_t
instead of a cast on the line below.
6b98e0b
to
2460d9e
Compare
This PR conflicted again. I don't know how to resolve this. Should I rebase to top of master and recreate another PR ? |
@tinysun212 You can rebase, squash, and |
2460d9e
to
246d9f2
Compare
I rebased and squashed all previous commits to one. And fixed some compile errors. Thank you. |
|
||
int lastRet = 0; | ||
|
||
// HMODULE modules[1024]; |
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.
Remove commented code?
@swift-ci Please test |
@tinysun212 Would you mind fixing the CMake issues that the buildbot found? You'd need to use |
88204ab
to
23fb980
Compare
@swift-ci Please test |
Currently, I have Linux and Windows platforms for development and not OS X platform. |
@tinysun212 Sorry, the OS X tests failing is not your fault. The master branch is broken now, we are working to get it fixed. This should land imminently and we'll re-run tests then. |
@swift-ci Please test |
@tinysun212 I'm sorry, could you fix the conflicts? The patch LGTM, I will merge immediately! |
23fb980
to
e06c713
Compare
@tinysun212 Thank you! |
@swift-ci Please smoke test |
@tinysun212 CI found an issue on Linux:
To fix, please merge the two definitions of |
@swift-ci Please smoke test |
@tinysun212 Sorry, CI is not happy again. You need to merge the definition into the top one, because there is an |
@gribozavr I'm sorry repetitive fail in same position. In this time, I tested the cmake-running (not build) in Linux. |
@swift-ci Please test |
OS X tests failed again. I think it is not my fault. Let me know if my action is needed. |
@tinysun212 Yes, that's existing breakage. Merging! Thank you for working on this! |
Rebased PR from previous.
I made several changes set for cygwin64 port.
The standard library can be used and It is possible to compile and run or interpret a simple hello swift source, but REPL, swift-build and swift-lldb does not work.
Currently, build process is not good, and many bugs may exist in.