Re: [PATCH] Add native windows on arm64 support - Mailing list pgsql-hackers

From Niyas Sait
Subject Re: [PATCH] Add native windows on arm64 support
Date
Msg-id CAFPTBD_NZb=q_6uE-QV+S+pm=Rc9sBKrg8CQ_Y3dc27Awrm7cQ@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Add native windows on arm64 support  (Thomas Munro <thomas.munro@gmail.com>)
Responses Re: [PATCH] Add native windows on arm64 support  (Julien Rouhaud <rjuju123@gmail.com>)
List pgsql-hackers
Thanks, Thomas for reviewing the patch!

Yes, we cannot turn off ASLR for Arm64 targets with MSVC. I haven't seen any issues so far on win/arm64 with this option turned off. I guess it should be okay. If we really need ASLR turned off, then I guess might have to use clang.

Yes, we could look into providing a build machine. Do you have any reference to what the CI system looks like now for PostgresSQL and how to add new workers etc.?

Niyas

On Fri, 18 Mar 2022 at 20:50, Thomas Munro <thomas.munro@gmail.com> wrote:
On Wed, Feb 23, 2022 at 11:09 PM Niyas Sait <niyas.sait@linaro.org> wrote:
> I have created a patch that adds support for building Postgres for the windows/arm64 platform using the MSVC toolchain. Following changes have been included
>
> 1. Extend MSVC scripts to handle ARM64 platform.
> 2. Add arm64 definition of spin_delay function.
> 3. Exclude arm_acle.h import with MSVC compiler.
>
> Compilation steps are consistent and similar to other windows platforms.
>
> The change has been tested on windows/x86_64 and windows/arm64 and all regression tests passes on both platforms.

+    # arm64 linker only supports dynamic base address
+    my $cfgrandbaseaddress = $self->{platform} eq 'ARM64' ? 'true' : 'false';
...
+      <RandomizedBaseAddress>$cfgrandbaseaddress</RandomizedBaseAddress>

Does that mean that you can't turn off ASLR on this arch?  Does it
cause random backend failures due to inability to map shared memory at
the expected address?  Our experience with EXEC_BACKEND on various
Unix systems tells us that you have to turn off ASLR if you want 100%
success rate on starting backends, but I guess it depends on the
details of how the randomisation is done.

Any interest in providing a build farm animal, so that we could know
that this works?

pgsql-hackers by date:

Previous
From: Alexey Kondratov
Date:
Subject: Re: Supply restore_command to pg_rewind via CLI argument
Next
From: Tatsuo Ishii
Date:
Subject: Re: [HACKERS] WIP aPatch: Pgbench Serialization and deadlock errors