Skip to content
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

Cannot run bflat on ARM64 #199

Open
queequac opened this issue Jun 15, 2024 · 8 comments
Open

Cannot run bflat on ARM64 #199

queequac opened this issue Jun 15, 2024 · 8 comments

Comments

@queequac
Copy link

queequac commented Jun 15, 2024

I downloaded the ZIP file manually as well as installed bflat 8.0.2 alternatively via winget.
In both cases I cannot run it on my ARM64 machine (Windows Developer Kit 2023, Windows 11 Pro, German locale)

It simply shows a dialog with The process entry point "__chkstk" was not found in the DLL "C:\...\bflat.exe".

@queequac
Copy link
Author

Supplement: It works fine on other machines, i.e. my work mate (Surface Book 3, Windows 10 Enterprise, German locale). Only difference between both machines: X64 instead of ARM64 and the OS version.

But cannot really imagine that there is an issue when using Windows 11 instead of 10, so I stick to my assumption that ARM64 does not execute bflat as expected.

@MichalStrehovsky
Copy link
Member

This symbol is normally provided by the Visual C++ runtime library, but bflat cannot ship those because they require a Visual Studio license. So instead bflat links against it's own shim of this library that pretty much has everything the linker complains about. chkstk is exported from kernel32.dll on x64 so there's no shim for this (it would have to be written in assembly). Looks like it's not exported on arm64.

The fix is probably to revert bflattened/runtime@739bfd9 but I don't have an ARM64 capable windows machine anymore so can't test.

@queequac
Copy link
Author

I can check later if I am able to build bflat. In that case I could test it for you on arm64 after reverting the mentioned commit.

@queequac
Copy link
Author

I am able to build bflat (had to add <CompilerHost Condition="'$(CompilerHost)' == '' and '$(NETCoreSdkRuntimeIdentifier)' == 'win-arm64'">windows-arm64</CompilerHost> to the project file when building on ARM64, but afterwards it worked and created the layouts).

Now I realized the commit to be reverted is in the runtime repo and the whole build process is simply downloading those packages. Any quick hint how I can build the runtime part and how to make the bflat build using my modified runtime?

@MichalStrehovsky
Copy link
Member

Checkout the bflat-release/8.0 branch and execute build.cmd clr.nativeaotruntime -c Release -arch arm64 (you might need some prerequisites such as CMake - the repo build is the same as for the official dotnet/runtime repo. You should get outputs under artifacts/bin/coreclr/windows.arm64.Release/aotsdk. The replace the binaries that bflat build downloaded with the new binaries.

I'll just try and see if I can produce the binaries for you to try. First step at bflattened/runtime#73.

@MichalStrehovsky
Copy link
Member

The CI run https://github.com/bflattened/bflat/actions/runs/9546778614 should have a possibly fixed build of bflat. Could you give bflat-windows-arm64.zip a try?

@queequac
Copy link
Author

Sorry for the late reply, I was distracted by a few things (incl. Euro24 😁).
The provided build runs like a charm. I did not test across all features, but I think it should work and would be a good candidate for an official release.

@MichalStrehovsky
Copy link
Member

Great, thank you! I'll need to run some validation myself and then release it

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

No branches or pull requests

2 participants