Re: [PATCH] Add native windows on arm64 support

From: Andres Freund <andres(at)anarazel(dot)de>
To: Dave Cramer <davecramer(at)postgres(dot)rocks>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Anthony Roberts <anthony(dot)roberts(at)linaro(dot)org>, Daniel Gustafsson <daniel(at)yesql(dot)se>, Lina Iyer <lina(dot)iyer(at)linaro(dot)org>, Mike Holmes <mike(dot)holmes(at)linaro(dot)org>, Peter Eisentraut <peter(at)eisentraut(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: [PATCH] Add native windows on arm64 support
Date: 2024-02-12 20:53:52
Message-ID: 20240212205352.aril2jxhmjqcrxev@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2024-02-09 15:32:10 -0500, Dave Cramer wrote:
> On Fri, 9 Feb 2024 at 14:36, Andres Freund <andres(at)anarazel(dot)de> wrote:
> > That's something like a segfault.
> >
> > One suspicion I have is that src/port/pg_crc32c_armv8_choose.c possibly
> > doesn't properly support msvc. It seems to assume that SIGILL can be
> > trapped,
> > but that IIRC doesn't work on windows.
> >
> > I'd check if the problem persists if you change
> > cdata.set('USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK', 1)
> > to
> > cdata.set('USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK', 0)
> >
>
> This results in
>
> FAILED: src/bin/pg_checksums/pg_checksums.exe
> src/bin/pg_checksums/pg_checksums.pdb
> "link" /MACHINE:ARM64 /OUT:src/bin/pg_checksums/pg_checksums.exe
> src/bin/pg_checksums/pg_checksums.exe.p/win32ver.res
> src/bin/pg_checksums/pg_checksums.exe.p/pg_checksums.c.obj "/release"
> "/nologo" "/DEBUG" "/PDB:src\bin\pg_checksums\pg_checksums.pdb"
> "/INCREMENTAL:NO" "/STACK:4194304" "/NOEXP" "src/fe_utils/libpgfeutils.a"
> "src/common/libpgcommon.a" "src/port/libpgport.a" "ws2_32.lib" "ws2_32.lib"
> "ws2_32.lib" "ws2_32.lib" "/SUBSYSTEM:CONSOLE" "kernel32.lib" "user32.lib"
> "gdi32.lib" "winspool.lib" "shell32.lib" "ole32.lib" "oleaut32.lib"
> "uuid.lib" "comdlg32.lib" "advapi32.lib"
> libpgcommon.a(controldata_utils.c.obj) : error LNK2001: unresolved external
> symbol pg_comp_crc32c

That's because have_optimized_crc ends up being set.

I'm somewhat unhappy about the msvc specific path in meson.build. Shouldn't at
the very least the "Use ARM CRC Extension unconditionally" path be first. I
guess it's not really this patch's fault that the runtime detection for armv8
crc is implemented this shoddily :(.

Greetings,

Andres Freund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2024-02-12 20:55:07 Re: Popcount optimization using AVX512
Previous Message Nathan Bossart 2024-02-12 20:51:38 Re: glibc qsort() vulnerability