Re: [PATCH] Add native windows on arm64 support

Niyas Sait <niyas.sait@linaro.org>

From: Niyas Sait <niyas.sait@linaro.org>
To: John Naylor <john.naylor@enterprisedb.com>
Cc: Michael Paquier <michael@paquier.xyz>, 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-02T09:50:20Z
Lists: pgsql-hackers
On 02/12/2022 05:41, John Naylor wrote:
>> I couldn't find something more official for the sse2neon library part.
> Not quite sure what this is referring to, but it seems we can just point to
> the __aarch64__ section in the same file, which uses the same instruction:
> 
> spin_delay(void)
> {
>    __asm__ __volatile__(
>    " isb; \n");
> }
> 
> ...and which already explains the choice with a comment.

Good point. Will add the comment.

> +  if cc.get_id() == 'msvc'
> +    cdata.set('USE_ARMV8_CRC32C', false)
> +    cdata.set('USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK', 1)
> +    have_optimized_crc = true
> +  else
> 
> That seems like a heavy-handed way to force it. Could we just use the same
> gating in the test program that the patch puts in the code of interest?
> Namely:
> 
> +#ifndef _MSC_VER
>  #include <arm_acle.h>
> +#endif
I took a similar approach as x86 MSVC code. I don't think the test 
program would work with MSVC. The compiler options are not MSVC friendly.

-- 
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