[PATCH] Fix build on MINGW on ARM64

Lars Kanis <lars@greiz-reinsdorf.de>

From: Lars Kanis <lars@greiz-reinsdorf.de>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-02-01T19:22:32Z
Lists: pgsql-hackers

Attachments

This patch limits the workaround of using __buildin_setjmp on the
Windows MINGW platform. This workaround is only necessary for legacy
MSVCRT based toolchain, but not for UCRT based. It is not available at
all on clang on ARM64 resulting in the following compiler error:

  error: __builtin_longjmp is not supported for the current target

This patch is used since years in MSYS2 packages:
  https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-postgresql/postgresql-14.0-use-mingw-setjmp-on-ucrt.patch

It is also used in ruby-pg to allow compiling for
aarch64-w64-windows-gnu: https://github.com/ged/ruby-pg/pull/626/files

It would be nice if this patch could be merged upstream.

--
Regards, Lars

Commits

  1. Revert "Use workaround of __builtin_setjmp only on MINGW on MSVCRT"

  2. Use workaround of __builtin_setjmp only on MINGW on MSVCRT