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

Draft: windows on arm lib support #5928

Closed
wants to merge 1 commit into from
Closed

Conversation

ahorek
Copy link
Contributor

@ahorek ahorek commented Dec 1, 2024

Related to #4697

Description of the Change
this allows compiling BOINC libraries with https://github.com/Windows-on-ARM-Experiments/mingw-woarm64-build/ for cross-compilation. Windows on ARM will officially be supported in the upcoming GCC 15.

Alternate Designs
Visual Studio is an alternative, it allows ARM targets, but it doesn't support cross-compilation, so using a GCC is more convenient because there's no need to access the real hardware.

while this change fixes the build
./configure --host="aarch64-windows" --with-boinc-platform="windows_aarch64" --disable-server --disable-manager --disable-client --disable-shared CXXFLAGS="-O3 "

I'm not sure what the platform string should be... ? https://boinc.berkeley.edu/trac/wiki/BoincPlatforms

I also have to run more tests to ensure it works with apps, so it's a draft for now, but any feedback is welcome. Thanks!

@AenBleidd AenBleidd marked this pull request as draft December 1, 2024 11:09
@AenBleidd
Copy link
Member

Thank you for your PR.
I converted it to 'Draft' since the same is mentioned in your PR title, and will review it later.
Just for the reference, Visual Studio supports cross-compilation, you just need to install required components to it, and it already builds for ARM64 on our CI:

Copy link
Member

@AenBleidd AenBleidd left a comment

Choose a reason for hiding this comment

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

Please also add one more CI flow to run ARM64 builds with mingw: https://github.com/BOINC/boinc/blob/master/.github/workflows/mingw.yml

@@ -75,7 +75,9 @@ void HOST_INFO::clear_host_info() {
safe_strcpy(os_version, "");

#ifdef _WIN64
#if !defined(__aarch64__)
Copy link
Member

Choose a reason for hiding this comment

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

All these are not required since WSL is supported on ARM64 devices as well: https://learn.microsoft.com/en-us/windows/wsl/install-manual

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, I'm encountering a relocation error during linking... let's see if I can find a better solution

@@ -148,6 +148,8 @@
#define SECURITY_WIN32
#endif

#include <cstddef>
Copy link
Member

Choose a reason for hiding this comment

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

is this really required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ahorek
Copy link
Contributor Author

ahorek commented Dec 1, 2024

Thank you for your PR. I converted it to 'Draft' since the same is mentioned in your PR title, and will review it later. Just for the reference, Visual Studio supports cross-compilation, you just need to install required components to it, and it already builds for ARM64 on our CI:

* https://github.com/BOINC/boinc/actions/runs/12100618832/job/33739454467

* https://github.com/BOINC/boinc/actions/runs/12100618832/job/33739454280

ok. Even with an empty hello world project, I'm getting LNK1112: module machine type 'x86' conflicts with target machine type 'ARM' , and the binary isn't generated. I'll see if there's a way to fix it somehow. Thanks

@ahorek
Copy link
Contributor Author

ahorek commented Dec 4, 2024

unfortunately, using https://github.com/Windows-on-ARM-Experiments/mingw-woarm64-build/ the app is crashing at boinc_init(). Without a backtrace or tools like gdb (which aren't available on Windows ARM), I probably won't be able to fix it.

It would be great to support GCC 15 for building Win+ARM once it becomes officially available. https://www.phoronix.com/news/GCC-aarch64-w64-mingw32 but this change doesn't seem to be sufficient.

@ahorek
Copy link
Contributor Author

ahorek commented Dec 4, 2024

btw I successfully built and tested the app in Visual Studio after installing additional ARM SDK libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

2 participants