Package: src:texlive-bin
Followup-For: Bug #931873
User: debian-sp...@lists.debian.org
Usertags: sparc64

Hi!

The attached patch should fix the issue. It just enables the alignment
fixes the code has for ARM and Solaris for Linux on SPARC which means
all machines where the compiler defines "__sparc__".

The most generic approach would be to replace all instances of

    ( defined(__sun) && defined(__SVR4))

with

    defined __sparc

since "__sparc" is defined on both Solaris/SPARC and Linux/SPARC (and
I'm quite confident it's also defined on Free,Open,NetBSD/SPARC).

Testing for "( defined(__sun) && defined(__SVR4))" actually assumes that
Solaris runs on SPARC only which is not the case. Solaris runs on x86
as well and x86 doesn't have these alignment issues. Hence, the proper
way is to detect the architecture and not the opering system.

Thanks,
Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
Description: Fix alignment issues on sparc64
Author: John Paul Adrian Glaubitz <glaub...@physik.fu-berlin.de>
Last-Update: 2019-08-15

--- texlive-bin-2019.20190605.51237.orig/texk/web2c/luatexdir/luapplib/ppconf.h
+++ texlive-bin-2019.20190605.51237/texk/web2c/luatexdir/luapplib/ppconf.h
@@ -3,7 +3,7 @@
 #define PP_CONF_H
 
 //#include "utilarm.h" // keep in sync
-#if defined __arm__ || defined __ARM__ || defined ARM || defined __ARM || 
defined __arm || defined __ARM_ARCH ||defined __aarch64__ ||( defined(__sun) && 
defined(__SVR4))
+#if defined __arm__ || defined __ARM__ || defined ARM || defined __ARM || 
defined __arm || defined __ARM_ARCH ||defined __aarch64__ ||defined __sparc__ 
||( defined(__sun) && defined(__SVR4))
 #  define ARM_COMPLIANT 1
 #else
 #  define ARM_COMPLIANT 0
--- texlive-bin-2019.20190605.51237.orig/texk/web2c/luatexdir/luapplib/ppheap.c
+++ texlive-bin-2019.20190605.51237/texk/web2c/luatexdir/luapplib/ppheap.c
@@ -15,7 +15,11 @@
 #if defined(__sun) && defined(__SVR4)
 # define PPHEAP_NEED_ALIGNMENT
 #endif
- 
+
+#if defined(__sparc__)
+# define PPHEAP_NEED_ALIGNMENT
+#endif
+
 #ifdef PPHEAP_NEED_ALIGNMENT 
 /* Tests has shown that long double seems to work: */
 /* for 32bit aligned_data has  algn: 64 as ppxref and ppref, */
--- 
texlive-bin-2019.20190605.51237.orig/texk/web2c/luatexdir/luapplib/util/utilarm.h
+++ texlive-bin-2019.20190605.51237/texk/web2c/luatexdir/luapplib/util/utilarm.h
@@ -1,10 +1,10 @@
 #ifndef UTIL_ARM_H
 #define UTIL_ARM_H
 
-#if defined __arm__ || defined __ARM__ || defined ARM || defined __ARM || 
defined __arm || defined __ARM_ARCH ||defined __aarch64__ ||( defined(__sun) && 
defined(__SVR4))
+#if defined __arm__ || defined __ARM__ || defined ARM || defined __ARM || 
defined __arm || defined __ARM_ARCH ||defined __aarch64__ ||defined __sparc__ 
||( defined(__sun) && defined(__SVR4))
 #  define ARM_COMPLIANT 1
 #else
 #  define ARM_COMPLIANT 0
 #endif
 
-#endif
\ No newline at end of file
+#endif

Reply via email to