[tlbuild] luajittex can now be built on x86_64-cygwin

Ken Brown kbrow1i at gmail.com
Sat Sep 19 18:56:04 CEST 2015


One of the Cygwin developers has succeeded in porting luajit to 64-bit 
Cygwin (https://www.cygwin.com/ml/cygwin/2015-09/msg00269.html), so it 
is now possible to build luajittex; patch attached.

I'm copying Mike Pall, the luajit author, since he said in 
correspondence last year that he would be interested in such a patch.

For TeX Live, one also needs the following:

Index: source/m4/kpse-setup.m4
===================================================================
--- source/m4/kpse-setup.m4	(revision 38399)
+++ source/m4/kpse-setup.m4	(working copy)
@@ -85,7 +85,7 @@
  AS_CASE([$enable_]Kpse_Pkg,
          [yes | no], [:],
            [AS_CASE([$host],
-                   [alpha* | sparc* | x86_64-*-cygwin | 
powerpc-*-darwin* ],
+                   [alpha* | sparc* | powerpc-*-darwin* ],
                       [AC_MSG_NOTICE([$host -> `--disable-]Kpse_Pkg['])
                        ac_configure_args="$ac_configure_args 
'--disable-]Kpse_Pkg['"])])
  ])


Ken
-------------- next part --------------
Index: source/libs/luajit/LuaJIT-2.1.0-beta1/src/lj_alloc.c
===================================================================
--- source/libs/luajit/LuaJIT-2.1.0-beta1/src/lj_alloc.c	(revision 38399)
+++ source/libs/luajit/LuaJIT-2.1.0-beta1/src/lj_alloc.c	(working copy)
@@ -196,7 +196,7 @@
   return ptr;
 }
 
-#elif LJ_TARGET_OSX || LJ_TARGET_PS4 || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__sun__)
+#elif LJ_TARGET_OSX || LJ_TARGET_PS4 || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__sun__) || defined(__CYGWIN__)
 
 /* OSX and FreeBSD mmap() use a naive first-fit linear search.
 ** That's perfect for us. Except that -pagezero_size must be set for OSX,
Index: source/libs/luajit/LuaJIT-2.1.0-beta1/src/lj_arch.h
===================================================================
--- source/libs/luajit/LuaJIT-2.1.0-beta1/src/lj_arch.h	(revision 38399)
+++ source/libs/luajit/LuaJIT-2.1.0-beta1/src/lj_arch.h	(working copy)
@@ -155,7 +155,11 @@
 #define LJ_ARCH_NAME		"x64"
 #define LJ_ARCH_BITS		64
 #define LJ_ARCH_ENDIAN		LUAJIT_LE
-#define LJ_ABI_WIN		LJ_TARGET_WINDOWS
+#if LJ_TARGET_WINDOWS || __CYGWIN__
+#define LJ_ABI_WIN		1
+#else
+#define LJ_ABI_WIN		0
+#endif
 #define LJ_TARGET_X64		1
 #define LJ_TARGET_X86ORX64	1
 #define LJ_TARGET_EHRETREG	0
Index: source/libs/luajit/LuaJIT-2.1.0-beta1/src/lj_err.c
===================================================================
--- source/libs/luajit/LuaJIT-2.1.0-beta1/src/lj_err.c	(revision 38399)
+++ source/libs/luajit/LuaJIT-2.1.0-beta1/src/lj_err.c	(working copy)
@@ -183,7 +183,7 @@
 
 /* -- External frame unwinding -------------------------------------------- */
 
-#if defined(__GNUC__) && !LJ_NO_UNWIND && !LJ_TARGET_WINDOWS
+#if defined(__GNUC__) && !LJ_NO_UNWIND && !LJ_ABI_WIN
 
 /*
 ** We have to use our own definitions instead of the mandatory (!) unwind.h,
@@ -349,7 +349,7 @@
 
 #endif
 
-#elif LJ_TARGET_X64 && LJ_TARGET_WINDOWS
+#elif LJ_TARGET_X64 && LJ_ABI_WIN
 
 /*
 ** Someone in Redmond owes me several days of my life. A lot of this is
@@ -414,7 +414,9 @@
     if (cf2) {  /* We catch it, so start unwinding the upper frames. */
       if (rec->ExceptionCode == LJ_MSVC_EXCODE ||
 	  rec->ExceptionCode == LJ_GCC_EXCODE) {
+#if LJ_TARGET_WINDOWS
 	__DestructExceptionObject(rec, 1);
+#endif
 	setstrV(L, L->top++, lj_err_str(L, LJ_ERR_ERRCPP));
       } else if (!LJ_EXCODE_CHECK(rec->ExceptionCode)) {
 	/* Don't catch access violations etc. */


More information about the tlbuild mailing list