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

Add support for ARM Windows #41

Merged
merged 1 commit into from
Dec 6, 2024
Merged

Conversation

KarlLudwig3485
Copy link
Contributor

Some simple fixes to allow Mlucas to be compiled with MinGW for armv7 and aarch64.

I've run -s m for both architectures with LTO enabled, both work fine.

My 2012 Surface RT may take a few years to run a PRP-DC, but modern ARM Windows laptops are genuinely useful.

You may remember my earlier foibles from April, which resulted in the "Cygwin" branch, which I can only describe as an artifact of the follies of my youth. This is the same thing, but done properly.

Also changes "Windows.h" to "windows.h" in getRealTime.c to fix MinGW cross-compilation under *nix.
@KarlLudwig3485 KarlLudwig3485 changed the title Add support for ARM Windows. Add support for ARM Windows Nov 20, 2024
Copy link
Member

@tdulcet tdulcet left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! This looks good to me, but I will give the other reviewers a chance to look at it before merging.

I suppose I can now go ahead and remove that Cygwin.

@@ -896,7 +896,7 @@ states that the compiler defines __64BIT__ if compiling in 64-bit mode.

The symbol __ARM_EABI__ is not defined if compiles under the old EABI.
*/
#if !(defined(__ARMEL__) && defined(__ARM_EABI__))
#if !defined (__MINGW32__) && !(defined(__ARMEL__) && defined(__ARM_EABI__))
Copy link
Member

Choose a reason for hiding this comment

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

Just curious, are either of those __ARMEL__ or __ARM_EABI__ symbols defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

__ARMEL__ is defined by armv7-w64-mingw32-clang but not aarch64-w64-mingw32-clang.
__ARM_EABI__ isn't defined by either.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the information. @ldesnogu - Do you know if either of these are important on ARM?

Copy link
Collaborator

@ldesnogu ldesnogu Nov 25, 2024

Choose a reason for hiding this comment

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

I think ARMEL and ARM_EABI are only applicable to 32-bit ARMv7.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm specifically targeting both 32-bit ARMv7 and the modern "ARM64" (aarch64) Windows. Windows' ARM ABI is based on the EABI, so there is no point to a check for OABI vs EABI, which is why there's no mechanism to do so i.e. the __ARM_EABI__ predefine.

I know that I'm probably the only person who will ever run Mlucas on 32-bit ARM Windows (Windows RT or Windows 10 build 15035), but it works fine on my Surface RT. It's incredibly slow though, so not something I would recommend to anyone without ridiculous amounts of patience.

@tdulcet tdulcet added the enhancement New feature or request label Nov 20, 2024
@tdulcet tdulcet merged commit 026e590 into primesearch:main Dec 6, 2024
22 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants