Re: [PATCH] Add native windows on arm64 support

Niyas Sait <niyas.sait@linaro.org>

From: Niyas Sait <niyas.sait@linaro.org>
To: Michael Paquier <michael@paquier.xyz>
Cc: Andres Freund <andres@anarazel.de>, Ian Lawrence Barwick <barwick@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Thomas Munro <thomas.munro@gmail.com>, Julien Rouhaud <rjuju123@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-12-05T08:54:52Z
Lists: pgsql-hackers
On 05/12/2022 05:12, Michael Paquier wrote:
> - Last comes OpenSSL, that supports amd64_arm64 as build target (see
> NOTES-WINDOWS.md), and the library names are libssl.lib and
> libcrypto.lib.  Looking at
> https://slproweb.com/products/Win32OpenSSL.html, there are
> experimental builds for arm64 with OpenSSL 3.0.  Niyas or somebody
> else, could you look at the contents of lib/VC/ and see what we could
> rely on for the debug builds after installing this MSI?  We should
> rely on something like lib/VC/sslcrypto64MD.lib or
> lib/VC/sslcrypto32MD.lib, but for arm64.

I tried that installer. And I can see following libraries installed in 
lib/VC location.

libcryptoarm64MD.lib
libcryptoarm64MDd.lib
libcryptoarm64MT.lib
libcryptoarm64MTd.lib
libsslarm64MD.lib
libsslarm64MDd.lib
libsslarm64MT.lib
libsslarm64MTd.lib

> -       USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK => undef,
> +       USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK => $self->{platform} eq "ARM64" ? : 1 : undef,
> Did you actually test this patch?  This won't work at all with perl,
> per se the double colon after the question mark.


Yes I did a full build. I am not sure why I didn't see any error with 
that. My perl skills are very limited and I started with something bit 
more naive like "$self->{platform} == "ARM64" ? : 1 : undef" But that 
didn't work and I changed to using eq and the compilation was fine. 
Thanks for fixing the patch.

 > For now, please find attached an updated patch with all the fixes I
 > could come up with.

Thanks. I did a quick sanity build with your updated patch and looks fine.

-- 
Niyas



Commits

  1. MSVC: Support building for AArch64.

  2. Remove "#ifdef WIN32" guards from src/port/win32*.c

  3. Adjust XML test case to avoid unstable behavior.

  4. Enable RandomizedBaseAddress (ASLR) on Windows with MSVC builds