Subject: bug#50666: 28.0.50; Fix native compilation on Cygwin

From: Ken Brown <[email-masked]>
Date: Thu, 28 Oct 2021 18:22:28 -0400

On 9/23/2021 1:13 PM, Ken Brown wrote:
> On 9/23/2021 12:37 PM, Eli Zaretskii wrote:
>>> From: Ken Brown <[email-masked]>
>>> Finally, as a side note, I don't think it would be a tragedy if this just turns
>>> out to be too complicated and we have to disable native compilation on 32-bit
>>> Cygwin.  The Cygwin home page at https://cygwin.com/ already contains the 
>>> following:
>>>
>>>     Address space is a very limiting factor for Cygwin. These days, a full
>>>     32 bit Cygwin distro is not feasible anymore, and will in all likelihood
>>>     fail in random places due to an issue with the fork(2) system call.
>>>
>>>     Therefore we recommend using 32 bit Cygwin only in limited scenarios, with
>>>     only a minimum of necessary packages installed, and only if there's no way
>>>     to run 64 bit Cygwin instead.
>>
>> My point is that maybe we should make that decision already, before
>> burning too much time and energy on it.
> 
>> Maybe you should ask on the
>> Cygwin list whether somebody will object to making 32-bit Cygwin Emacs
>> a second-class citizen.
> 
> Well, 32-bit Cygwin is already a second-class citizen, so we might just have to 
> do that whether someone objects or not.

32-bit Cygwin has just been demoted to a third-class citizen.  Cygwin 3.3.0 was 
released this morning, with a deprecation notice that it is the last major 
version supporting 32-bit installations.  In view of this, I don't want to put 
any energy into supporting native compilation on 32-bit Cygwin, and I doubt if 
Achim does either.

Eli, what do you think of the attached (assuming Achim agrees)?

Ken

From 7299a38ef7a6eced22b9506e0f68416fdb06986b Mon Sep 17 00:00:00 2001
From: Ken Brown <[email-masked]>
Date: Fri, 8 Oct 2021 14:29:08 -0400
Subject: [PATCH] Drop support for native compilation on 32-bit Cygwin

* configure.ac [i686-pc-cygwin]: Don't allow native compilation
unless ENABLE_NATIVE=yes.  (Bug#50666)
---
 configure.ac | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/configure.ac b/configure.ac
index e6ffea0637..0ddf917de2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3814,6 +3814,13 @@ AC_DEFUN
 HAVE_NATIVE_COMP=no
 LIBGCCJIT_LIBS=
 LIBGCCJIT_CFLAGS=
+if test "$canonical" = i686-pc-cygwin && \
+  test "${with_native_compilation}" != no && \
+  test "x${NATIVE_ENABLED}" != xyes; then
+    AC_MSG_ERROR([Native compilation is not supported on 32-bit Cygwin.
+If you want to try it anyway, reconfigure with NATIVE_ENABLED=yes.])
+fi
+
 if test "${with_native_compilation}" != "no"; then
     if test "${HAVE_PDUMPER}" = no; then
        AC_MSG_ERROR(['--with-native-compilation' requires '--with-dumping=pdumper'])
-- 
2.33.0