Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Progress towards x86 Windows support #7944

Merged
merged 7 commits into from
Jan 9, 2020
Merged

Conversation

MichalStrehovsky
Copy link
Member

This, along with #7943 and dotnet/runtime#1451 is enough to get my snake game running on x86 Windows.

See individual commits for details.

I'm not particularly happy with the "Fix ObjWriter build" commit - building LLVM with the forced stdcall calling convention hits some template expansion snafu and I had to back it out in a weird way.

@@ -183,10 +183,6 @@ if(WIN32)
add_compile_options(/source-charset:utf-8) # Force MSVC to compile source as UTF-8.
add_compile_options(/Zi) # enable debugging information
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DEBUG")

Copy link
Member

Choose a reason for hiding this comment

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

Is it necessary to remove it here, now that there is REMOVE_ITEM for it in the ObjWriter part?

Copy link
Member Author

Choose a reason for hiding this comment

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

I could have sworn I tried that before and it didn't work, but tried again and it did...


case ReadyToRunHelperId.GetThreadStaticBase:
{
throw new NotImplementedException();
Copy link
Member

Choose a reason for hiding this comment

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

I was also working on a version of this patch: am11@dfa63ec, these cases were implemented using EmitLEA and EmitLEAQ. Could you squeeze those in? It compiles on Linux. :)

Copy link
Member Author

Choose a reason for hiding this comment

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

EmitLEAQ will be replaced by EmitMOV on x86. I've added a commit that generates int 3 instructions for these helpers - that way the compilation will proceed to the next problem and we'll get broken into the debugger when this is reached at runtime. I don't want to blindly add untested code because this is generally better to step through in a debugger to verify it really does the right thing. Porting these should be straightforward except for the delegate creation helper because we don't have enough registers to pass the 3 arguments to it. We can do something dirty when we get to that.

I've added a couple more things that should help Linux to successfully compile. It doesn't compile on Windows because CoreCLR uses a weird exception handling model on x86 Windows and RyuJIT is generating that (I believe it uses normal funclet-based model on x86 Unix). We'll need to fix up RyuJIT to use FEATURE_EH_FUNCLETS on Windows for CoreRT too. I don't think I'll get to that anytime soon. x86 Linux might be more realistic.

@jkotas jkotas merged commit 9ef8d4d into dotnet:master Jan 9, 2020
MichalStrehovsky added a commit to MichalStrehovsky/runtime that referenced this pull request Jan 14, 2020
Changes from dotnet/corert#7944 to enable x86 support.
jkotas pushed a commit to dotnet/runtime that referenced this pull request Jan 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants