-
Notifications
You must be signed in to change notification settings - Fork 510
X86 runtime build fails #4589
Comments
Hey @morganbr, I gave it a shot out of curiosity and got to a point where it requires to implement/port more unwinding features for x86 in and around JITCodeManager. One suggestion (which may cleanup some code): port CoreCLR's |
JITCodeManager can be excluded from the i386 completely (ie it can be included for x64 only). It is experimental component that is not required for CoreRT to work today. |
https://github.com/dotnet/corert/blob/master/src/Native/jitinterface/CMakeLists.txt#L10 is a good place to do it. |
The native parts now build on x86, for managed parts, I think aside from dotnet-cli for x86 Linux/Windows, we need to object-writer from LLILC for Linux-x86 (along with linux-x64, alpine.3.6-x64) RIDs. Something similar to this: dotnet/llilc@8dc6363. @jkotas, @janvorli, (unless ObjectWriter build has dependency on CoreCLR and LLVM) are there plans to bring ObjectWriter to CoreRT repo as there has been no activity in llilc repo in a while. I suppose, this package in CoreRT repo will be comparatively well-maintained and continuously update to new RID conventions (e.g. |
We have been re-building ObjectWriter package from llilc repo manually as needed because of it is not changing frequently. Having the source for it in CoreRT repo makes sense. The plan can be something like:
|
@jkotas, the one-off build appears to be quite involved if we follow the documented build steps. I ended up compiling entire LLILC repo (ObjectWriter branch) as an LLVM plugin. Tested only the Windows x64 build, as there are missing x86 implementations which I guess would require a separate effort. With current infrastructure, we have to first compile CoreCLR, then LLILC as LLVM's tool. This can probably be re-wired in ObjectWriter's cmake script to reduce the amount of steps and repos to clone. Is it a possibility that dependency on ObjectWriter for ILC is removed in future or ObjectWriter's dependency on LLVM is substituted with custom implementation? |
Compiling CoreCLR should not be required to compile ObjectWriter.
We have used ObjectWriter to bootstrap the project faster. We went back and forth on whether/when we should replace it with custom implementation. There is no immediate plan to remove it, but there is a chance that it will be removed in future. |
2 years.... x86 support keep planned? |
Would you like to help us make progress with it? I recently fixed on of the issues in #7773, but nobody is actively looking at this. |
ObjectWriter (which was one of the obstacle) has been since moved to CoreRT repo, so it might also help speed up the x86 bringup. |
Glad to know there is still hope for x86, |
It's possible to learn these things as you go. The first step would be to clone the repo and try to build it. Make sure you have the prerequisites and run Once you verify you can build x64, it's time to try x86. Just add the |
Well, it doesn't hurt to try, although I don't think I'll make it. |
On Linux i386, build fails when compiling #!/usr/bin/env sh
docker build -t corert-x86 - << EOF
FROM i386/ubuntu
RUN apt update
RUN apt install -y clang cmake git
RUN git clone https://github.com/dotnet/corert --single-branch
WORKDIR /corert
RUN ./build.sh objwriter skiptests x86
EOF
fails with: [ 60%] Building CXX object Runtime/Portable/CMakeFiles/PortableRuntime.dir/__/__/gc/unix/cgroup.cpp.o
/corert/src/Native/Runtime/unix/UnwindHelpers.cpp:37:2: error: "Unwinding is not implemented for this architecture yet."
#error "Unwinding is not implemented for this architecture yet."
^
/corert/src/Native/Runtime/unix/UnwindHelpers.cpp:593:6: error: "Unwinding is not implemented for this architecture yet."
#error "Unwinding is not implemented for this architecture yet."
^
/corert/src/Native/Runtime/unix/UnwindHelpers.cpp:597:19: error: use of undeclared identifier 'uc'
bool retVal = uc.getInfoFromDwarfSection(pc, uwInfoSections, 0 /* fdeSectionOffsetHint */);
^
/corert/src/Native/Runtime/unix/UnwindHelpers.cpp:604:5: error: use of undeclared identifier 'uc'
uc.getInfo(&procInfo);
^
/corert/src/Native/Runtime/unix/UnwindHelpers.cpp:613:42: error: use of undeclared identifier 'Registers_REGDISPLAY'
DwarfInstructions<LocalAddressSpace, Registers_REGDISPLAY> dwarfInst;
^
/corert/src/Native/Runtime/unix/UnwindHelpers.cpp:614:86: error: use of undeclared identifier 'Registers_REGDISPLAY'
int stepRet = dwarfInst.stepWithDwarf(_addressSpace, pc, procInfo.unwind_info, *(Registers_REGDISPLAY*)regs);
^
/corert/src/Native/Runtime/unix/UnwindHelpers.cpp:614:107: error: expected expression
int stepRet = dwarfInst.stepWithDwarf(_addressSpace, pc, procInfo.unwind_info, *(Registers_REGDISPLAY*)regs);
^
/corert/src/Native/Runtime/unix/UnwindHelpers.cpp:614:19: error: use of undeclared identifier 'dwarfInst'
int stepRet = dwarfInst.stepWithDwarf(_addressSpace, pc, procInfo.unwind_info, *(Registers_REGDISPLAY*)regs);
^
8 errors generated. |
That will probably require fixes similar to what was done in #7504 for ARM64. |
Has there been any progress on this since the last pull request? Would be nice if there was something I could do to help this effort. |
I hope at least we get x86 support before the CoreRT exit of 'experimental stage' |
#7931 has a small fix for cross-compile. Full product is built (native + managed) using cross compile for x86 on x64 system: #!/usr/bin/env sh
git clone https://github.com/dotnet/corert
cd corert
# create rootfs once, "sudo" is not required when running as root
sudo cross/build-rootfs.sh x86
# cross compile
./build.sh cross x86 TestsILCompiler and reflection metadata tests are passing but then there is a whole bunch of test failures uniquely due to the following two reasons:
and:
|
Some more progress (for Windows x86 this time) in #7944. |
god is real |
Hello Michal, |
Note that x86 support on Windows is incomplete and you won't be able to run much more than the no-runtime zerosharp sample. |
I see. So when you wrote about compiling the snake game you also had to add all the "supplementary" code (and probably more) that is in "no-runtime zerosharp sample", right? |
Yes, it was the 2 kB selfcontained version of the game: https://twitter.com/MStrehovsky/status/1214955686397980673 |
There are a number of failures building for x86. This should be doable since the same sources get built for x86 as part of .NET Native.
8>e:\corert\corert\src\native\jitinterface\JITCodeManager.h(96): error C2143: syntax error: missing ';' before '*' [E:\corert\corert\bin\obj\Native\Windows_NT.x86.Debug\jitinterface\jitinterface.vcxproj]
8>e:\corert\corert\src\native\jitinterface\JITCodeManager.h(96): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [E:\corert\corert\bin\obj\Native\Windows_NT.x86.Debug\jitinterface\jitinterface.vcxproj]
8>e:\corert\corert\src\native\jitinterface\JITCodeManager.h(173): error C3646: 'm_pRuntimeFunctionTable': unknown override specifier [E:\corert\corert\bin\obj\Native\Windows_NT.x86.Debug\jitinterface\jitinterface.vcxproj]
8>e:\corert\corert\src\native\jitinterface\JITCodeManager.h(173): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [E:\corert\corert\bin\obj\Native\Windows_NT.x86.Debug\jitinterface\jitinterface.vcxproj]
8>e:\corert\corert\src\native\jitinterface\JITCodeManager.h(229): error C3646: 'AllocRuntimeFunction': unknown override specifier [E:\corert\corert\bin\obj\Native\Windows_NT.x86.Debug\jitinterface\jitinterface.vcxproj]
8>e:\corert\corert\src\native\jitinterface\JITCodeManager.h(229): error C2059: syntax error: '(' [E:\corert\corert\bin\obj\Native\Windows_NT.x86.Debug\jitinterface\jitinterface.vcxproj]
8>e:\corert\corert\src\native\jitinterface\JITCodeManager.h(229): error C2238: unexpected token(s) preceding ';' [E:\corert\corert\bin\obj\Native\Windows_NT.x86.Debug\jitinterface\jitinterface.vcxproj]
8>e:\corert\corert\src\native\runtime\coreclr\gcinfotypes.h(326): fatal error C1083: Cannot open include file: 'bitvector.h': No such file or directory [E:\corert\corert\bin\obj\Native\Windows_NT.x86.Debug\jitinterface\jitinterface.vcxproj]
4>E:\corert\corert\src\Native\Runtime\thread.cpp(600): error C2664: 'UInt32 PalHijack(HANDLE,PalHijackCallback,void *)': cannot convert argument 2 from 'UInt32_BOOL (__cdecl *)(HANDLE,PAL_LIMITED_CONTEXT *,void *)' to 'PalHijackCallback' [E:\corert\corert\bin\obj\Native\Windows_NT.x86.Debug\Runtime\Portable\PortableRuntime.vcxproj]
4>E:\corert\corert\src\Native\Runtime\windows\PalRedhawkCommon.cpp(225): error C2373: 'PalGetProcessCpuCount': redefinition; different type modifiers [E:\corert\corert\bin\obj\Native\Windows_NT.x86.Debug\Runtime\Portable\PortableRuntime.vcxproj]
E:\corert\corert\src\Native\Runtime\PalRedhawk.h(694): note: see declaration of 'PalGetProcessCpuCount'
4>E:\corert\corert\src\Native\Runtime\windows\PalRedhawkCommon.cpp(249): error C2373: 'PalReadFileContents': redefinition; different type modifiers [E:\corert\corert\bin\obj\Native\Windows_NT.x86.Debug\Runtime\Portable\PortableRuntime.vcxproj]
E:\corert\corert\src\Native\Runtime\PalRedhawk.h(696): note: see declaration of 'PalReadFileContents'
4>E:\corert\corert\src\Native\Runtime\windows\PalRedhawkCommon.cpp(285): error C2373: 'PalGetMaximumStackBounds': redefinition; different type modifiers [E:\corert\corert\bin\obj\Native\Windows_NT.x86.Debug\Runtime\Portable\PortableRuntime.vcxproj]
E:\corert\corert\src\Native\Runtime\PalRedhawk.h(701): note: see declaration of 'PalGetMaximumStackBounds'
PalRedhawkMinWin.cpp
4>E:\corert\corert\src\Native\Runtime\windows\PalRedhawkMinWin.cpp(115): error C2373: 'PalAttachThread': redefinition; different type modifiers [E:\corert\corert\bin\obj\Native\Windows_NT.x86.Debug\Runtime\Portable\PortableRuntime.vcxproj]
e:\corert\corert\src\native\runtime\PalRedhawk.h(822): note: see declaration of 'PalAttachThread'
4>E:\corert\corert\src\Native\Runtime\windows\PalRedhawkMinWin.cpp(137): error C2373: 'PalDetachThread': redefinition; different type modifiers [E:\corert\corert\bin\obj\Native\Windows_NT.x86.Debug\Runtime\Portable\PortableRuntime.vcxproj]
e:\corert\corert\src\native\runtime\PalRedhawk.h(823): note: see declaration of 'PalDetachThread'
4>E:\corert\corert\src\Native\Runtime\windows\PalRedhawkMinWin.cpp(192): error C2373: 'PalGetModuleFileName': redefinition; different type modifiers [E:\corert\corert\bin\obj\Native\Windows_NT.x86.Debug\Runtime\Portable\PortableRuntime.vcxproj]
e:\corert\corert\src\native\runtime\PalRedhawk.h(704): note: see declaration of 'PalGetModuleFileName'
4>E:\corert\corert\src\Native\Runtime\windows\PalRedhawkMinWin.cpp(1811): error C2664: 'HANDLE CreateThread(LPSECURITY_ATTRIBUTES,SIZE_T,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPDWORD)': cannot convert argument 3 from 'DWORD (__cdecl *)(void *)' to 'LPTHREAD_START_ROUTINE' [E:\corert\corert\bin\obj\Native\Windows_NT.x86.Debug\Runtime\Portable\PortableRuntime.vcxproj]
E:\corert\corert\src\Native\Runtime\windows\PalRedhawkMinWin.cpp(1811): note: None of the functions with this name in scope match the target type
The text was updated successfully, but these errors were encountered: