Skip to content

Fix helloworld on x86 Linux - #55095

Merged
jkotas merged 2 commits into
dotnet:mainfrom
t-mustafin:fix_x86_linux_helloworld
Jul 9, 2021
Merged

Fix helloworld on x86 Linux#55095
jkotas merged 2 commits into
dotnet:mainfrom
t-mustafin:fix_x86_linux_helloworld

Conversation

@t-mustafin

Copy link
Copy Markdown
Contributor

Working on helloworld.dll x86 linux launch I've got problem during calling convention on managed call from managed code. I fixed it in morph.cpp. After that fix I had got bugs with stack misalignment. Couple of that problems I fixed in compiler.cpp and jitinterfacex86.cpp. It allows to run helloworld.dll and stack dumping with System.Diagnostics.StackTrace. But I still have got similar stack misalignment problems on another programs.
Is that fix-work direction right? Maybe I should fix managed-managed calling convention in another way?
cc @jkotas@alpencolt

@ghostghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 2, 2021
@jkotas

Copy link
Copy Markdown
Member

It looks like a reasonable direction to me.

@t-mustafin
t-mustafinforce-pushed the fix_x86_linux_helloworld branch from 22834b4 to 1644a0eCompareJuly 7, 2021 17:09
@t-mustafin
t-mustafin marked this pull request as ready for review July 7, 2021 17:11
@t-mustafint-mustafin changed the title [WIP] Fix helloworld on x86 LinuxFix helloworld on x86 LinuxJul 7, 2021
@jkotas

Copy link
Copy Markdown
Member

A lot of tests on Windows x64 are failing with errors like:

 Fatal error. 0xC0000005
at Microsoft.CSharp.RuntimeBinder.ComInterop.IDispatchComObject.EnsureScanDefinedMethods()

Comment threadsrc/coreclr/jit/morph.cpp Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

VarArgs is not supported on Unix, so this will be always false. Would it be better to put this whole block under #ifndef UNIX_X86_ABI ?

Make managed->managed call use of ecx, edx to pass first two arguments.
Make stack alignment returning after call.
@t-mustafin
t-mustafinforce-pushed the fix_x86_linux_helloworld branch from a6f9fcb to d1b6466CompareJuly 9, 2021 14:46

@jkotasjkotas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks!

@jkotas
jkotas merged commit 39d1161 into dotnet:mainJul 9, 2021
@t-mustafin
t-mustafin deleted the fix_x86_linux_helloworld branch July 9, 2021 20:52
@runfoapprunfoappBot mentioned this pull request Jul 10, 2021
@ghostghost locked as resolved and limited conversation to collaborators Aug 8, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@t-mustafin@jkotas