From 0a2e5ac1c0da559d2c37227a81232ce3ea75aade Mon Sep 17 00:00:00 2001 From: "Serge S. Gulin" Date: Fri, 3 Jan 2025 22:44:23 +0300 Subject: [PATCH] Add support for Windows Aarch64 Co-authored-by: Cheng Shao --- Cabal/src/Distribution/Compat/Environment.hs | 2 +- .../src/Distribution/Client/Compat/ExecutablePath.hs | 2 +- changelog.d/pr-10705 | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 changelog.d/pr-10705 diff --git a/Cabal/src/Distribution/Compat/Environment.hs b/Cabal/src/Distribution/Compat/Environment.hs index ffe278bcc54..8cc9d582ad9 100644 --- a/Cabal/src/Distribution/Compat/Environment.hs +++ b/Cabal/src/Distribution/Compat/Environment.hs @@ -63,7 +63,7 @@ setEnv_ key value = withCWString key $ \k -> withCWString value $ \v -> do {- FOURMOLU_DISABLE -} # if defined(i386_HOST_ARCH) # define WINDOWS_CCONV stdcall -# elif defined(x86_64_HOST_ARCH) +# elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH) # define WINDOWS_CCONV ccall # else # error Unknown mingw32 arch diff --git a/cabal-install/src/Distribution/Client/Compat/ExecutablePath.hs b/cabal-install/src/Distribution/Client/Compat/ExecutablePath.hs index e805c110d60..fa989a6bd0f 100644 --- a/cabal-install/src/Distribution/Client/Compat/ExecutablePath.hs +++ b/cabal-install/src/Distribution/Client/Compat/ExecutablePath.hs @@ -123,7 +123,7 @@ getExecutablePath = readSymbolicLink $ "/proc/self/exe" # if defined(i386_HOST_ARCH) # define WINDOWS_CCONV stdcall -# elif defined(x86_64_HOST_ARCH) +# elif defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH) # define WINDOWS_CCONV ccall # else # error Unknown mingw32 arch diff --git a/changelog.d/pr-10705 b/changelog.d/pr-10705 new file mode 100644 index 00000000000..09532048fc8 --- /dev/null +++ b/changelog.d/pr-10705 @@ -0,0 +1,8 @@ +--- +synopsis: 'Add support for Windows Aarch64' +packages: [Cabal, cabal-install] +prs: 10705 +--- + +Adds to preprocessor branches the option to support `aarch64_HOST_ARCH` platform on Windows Aarch64 target. +`ccall` convention is used at Aarch64, same as for `x86_64_HOST_ARCH`.