[packages/smalltalk] - added x32 patch (partial, fixes two issues, but more exist) - added longdouble patch (disable assu

qboosh qboosh at pld-linux.org
Sun Feb 12 16:40:48 CET 2023


commit deb252f4427ceba2b54d5c4f8364a53b72a54430
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Feb 12 16:42:12 2023 +0100

    - added x32 patch (partial, fixes two issues, but more exist)
    - added longdouble patch (disable assumption about long double size on i386/x86_64

 smalltalk-longdouble.patch | 18 ++++++++++++++++++
 smalltalk-x32.patch        | 25 +++++++++++++++++++++++++
 smalltalk.spec             |  6 ++++++
 3 files changed, 49 insertions(+)
---
diff --git a/smalltalk.spec b/smalltalk.spec
index 6135880..8fa9213 100644
--- a/smalltalk.spec
+++ b/smalltalk.spec
@@ -14,6 +14,8 @@ Source1:	%{name}.desktop
 Source2:	%{name}.png
 Patch0:		%{name}-proc.patch
 Patch1:		%{name}-info.patch
+Patch2:		%{name}-x32.patch
+Patch3:		%{name}-longdouble.patch
 URL:		http://www.gnu.org/software/smalltalk/
 BuildRequires:	OpenGL-devel
 BuildRequires:	OpenGL-glut-devel
@@ -43,6 +45,8 @@ BuildRequires:	texinfo
 BuildRequires:	tk-devel >= 8.4
 BuildRequires:	zlib-devel
 Requires(post,postun):	/sbin/ldconfig
+# as of 3.2.5 fails probably because of issues with size of limb != size of pointer
+ExcludeArch:	x32
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 # smalltalk uses -Wno-format (see GST_PROG_CC in configure.ac)
@@ -181,6 +185,8 @@ Moduł OpenGL dla GNU Smalltalka.
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
+%patch3 -p1
 
 %build
 %configure \
diff --git a/smalltalk-longdouble.patch b/smalltalk-longdouble.patch
new file mode 100644
index 0000000..f6ab1aa
--- /dev/null
+++ b/smalltalk-longdouble.patch
@@ -0,0 +1,18 @@
+--- smalltalk-3.2.5/libgst/dict.inl.orig	2013-04-07 21:24:12.000000000 +0200
++++ smalltalk-3.2.5/libgst/dict.inl	2023-02-11 19:13:44.149203321 +0100
+@@ -578,15 +578,9 @@ floatq_new (long double f)
+   OOP floatOOP;
+   gst_object obj = new_instance_with (_gst_floatq_class, 16, &floatOOP);
+ 
+-#if defined __i386__ || defined __x86_64__
+-  /* Two bytes (six on x86-64) of 80-bit long doubles are unused.  */
+-  memcpy (&obj->data, &f, 10);
+-  memset (((char *)obj->data) + 10, 0, 6);
+-#else
+   memcpy (&obj->data, &f, sizeof (long double));
+   memset (((char *)obj->data) + sizeof (long double), 0,
+ 	  16 - sizeof (long double));
+-#endif
+ 
+   MAKE_OOP_READONLY (floatOOP, true);
+   return (floatOOP);
diff --git a/smalltalk-x32.patch b/smalltalk-x32.patch
new file mode 100644
index 0000000..e68b857
--- /dev/null
+++ b/smalltalk-x32.patch
@@ -0,0 +1,25 @@
+Fix assembler operations (x32 uses 32-bit OPP)
+Fix uninitialized variables in _gst_mpz_from_oop
+Still not sufficient - probably more work needed for size of limb != size of pointer
+--- smalltalk-3.2.5/libgst/interp.inl.orig	2013-04-07 21:24:12.000000000 +0200
++++ smalltalk-3.2.5/libgst/interp.inl	2023-02-11 18:16:19.552251830 +0100
+@@ -76,7 +76,7 @@ static inline OOP tagged_xor (OOP op1, O
+ } while(0)
+ 
+ 
+-#if defined __i386__
++#if defined __i386__ || defined __ILP32__
+ #define OP_SUFFIX "l"
+ #define OP_CONSTRAINT "rmi"
+ #else
+--- libgst/mpz.c.orig	2013-03-23 20:56:26.000000000 +0100
++++ libgst/mpz.c	2023-02-11 21:25:51.542429365 +0100
+@@ -1670,6 +1670,8 @@ _gst_mpz_from_oop(gst_mpz *mpz, OOP srcO
+       /* We have half a limb in the LargeInteger, so we cannot work
+ 	 directly in the object data.  */
+ 
++      gst_mpz_realloc(mpz, n);
++      dest = mpz->d;
+       mpz->size = n;
+       while (n--)
+ 	*dest++ = ~*src++;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/smalltalk.git/commitdiff/deb252f4427ceba2b54d5c4f8364a53b72a54430



More information about the pld-cvs-commit mailing list