The package rpms/polyml.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/polyml.git/commit/?id=ea7c57e0bf5....
Change:
+%ifarch %{arm}
Thanks.
Full change:
============
commit ea7c57e0bf590c3bb7f72ea07f458dedbcb1a056
Author: Jerry James <loganjerry(a)gmail.com>
Date: Sat May 18 09:45:29 2019 -0600
Add -fixes patch to fix s390x build.
diff --git a/polyml-fixes.patch b/polyml-fixes.patch
new file mode 100644
index 0000000..21fb61c
--- /dev/null
+++ b/polyml-fixes.patch
@@ -0,0 +1,140 @@
+diff --git a/Tests/Succeed/Test187.ML b/Tests/Succeed/Test187.ML
+new file mode 100644
+index 00000000..774f888c
+--- /dev/null
++++ b/Tests/Succeed/Test187.ML
+@@ -0,0 +1,4 @@
++(* This could segfault if GMP was enabled due to a bug in neg_longc. *)
++
++val x = ~ (LargeInt.fromInt(valOf FixedInt.maxInt)) - 1;
++PolyML.IntInf.gcd(x, 0);
+diff --git a/configure.ac b/configure.ac
+index e7e080cf..ee916314 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -581,7 +581,7 @@ AM_CONDITIONAL([MACOSLDOPTS], [test "$poly_need_macosopt" =
yes ])
+
+ # If we're building only the static version of libpolyml
+ # then polyc and polyml.pc have to include the dependent libraries.
+-dependentlibs = ""
++dependentlibs=""
+ if test "${enable_shared}" != yes; then
+ dependentlibs=${LIBS}
+ fi
+diff --git a/configure b/configure
+index cfbc90da..9279c8c8 100755
+--- a/configure
++++ b/configure
+@@ -22488,7 +22488,7 @@ fi
+
+ # If we're building only the static version of libpolyml
+ # then polyc and polyml.pc have to include the dependent libraries.
+-dependentlibs = ""
++dependentlibs=""
+ if test "${enable_shared}" != yes; then
+ dependentlibs=${LIBS}
+ fi
+diff --git a/libpolyml/arb.cpp b/libpolyml/arb.cpp
+index a1878363..e79d35d0 100644
+--- a/libpolyml/arb.cpp
++++ b/libpolyml/arb.cpp
+@@ -594,7 +594,7 @@ Handle neg_longc(TaskData *taskData, Handle x)
+ Handle long_y = alloc_and_save(taskData, WORDS(bytes), F_MUTABLE_BIT|F_BYTE_OBJ);
+ byte *v = DEREFBYTEHANDLE(long_y);
+ if (IS_INT(DEREFWORD(x)))
+- memcpy(v, (byte*)x_extend, bytes);
++ memcpy(v, &x_extend, bytes);
+ else memcpy(v, DEREFBYTEHANDLE(x), bytes);
+ #ifndef USE_GMP
+ // Make sure the last word is zero. We may have unused bytes there.
+diff --git a/libpolyml/basicio.cpp b/libpolyml/basicio.cpp
+index 38dc5894..ac1b1a6e 100644
+--- a/libpolyml/basicio.cpp
++++ b/libpolyml/basicio.cpp
+@@ -200,7 +200,7 @@ int getStreamFileDescriptorWithoutCheck(PolyWord strm)
+ // the standard streams which are tagged integers.
+ if (strm.IsTagged())
+ return strm.UnTagged();
+- return *(int*)(strm.AsObjPtr()) -1;
++ return *(intptr_t*)(strm.AsObjPtr()) -1;
+ }
+
+ // Most of the time we want to raise an exception if the file descriptor
+@@ -254,7 +254,7 @@ static Handle close_file(TaskData *taskData, Handle stream)
+ if (descr > 2)
+ {
+ close(descr);
+- *(int*)(stream->WordP()) = 0; // Mark as closed
++ *(intptr_t*)(stream->WordP()) = 0; // Mark as closed
+ }
+
+ return Make_fixed_precision(taskData, 0);
+@@ -798,9 +798,6 @@ static Handle IO_dispatch_c(TaskData *taskData, Handle args, Handle
strm, Handle
+ case 6: /* Open file for binary output. */
+ return open_file(taskData, args, O_WRONLY | O_CREAT | O_TRUNC, 0666, 0);
+ case 7: /* Close file */
+- // Legacy: During the bootstrap we will have old format references.
+- if (strm->Word().IsTagged())
+- return Make_fixed_precision(taskData, 0);
+ return close_file(taskData, strm);
+ case 8: /* Read text into an array. */
+ return readArray(taskData, strm, args, true);
+diff --git a/libpolyml/interpret.cpp b/libpolyml/interpret.cpp
+index a14fd961..fee91117 100644
+--- a/libpolyml/interpret.cpp
++++ b/libpolyml/interpret.cpp
+@@ -1329,7 +1329,9 @@ int IntTaskData::SwitchToPoly()
+ Handle reset = this->saveVec.mark();
+ Handle pushedArg1 = this->saveVec.push(*sp++);
+ Handle pushedArg2 = this->saveVec.push(*sp);
++ SaveInterpreterState(pc, sp); // mult_longc allocates memory and may GC even
if it doesn't overflow.
+ Handle result = mult_longc(this, pushedArg2, pushedArg1);
++ LoadInterpreterState(pc, sp);
+ PolyWord res = result->Word();
+ this->saveVec.reset(reset);
+ if (! res.IsTagged())
+diff --git a/libpolyml/poly_specific.cpp b/libpolyml/poly_specific.cpp
+index b92a5d5a..e484695f 100644
+--- a/libpolyml/poly_specific.cpp
++++ b/libpolyml/poly_specific.cpp
+@@ -376,11 +376,21 @@ POLYUNSIGNED PolySetCodeConstant(PolyWord closure, PolyWord offset,
PolyWord cWo
+ case 0: // Absolute constant - size PolyWord
+ {
+ POLYUNSIGNED c = cWord.AsUnsigned();
++#ifdef WORDS_BIGENDIAN
++ // This is used to store constants in the constant area
++ // on the interpreted version.
++ for (unsigned i = sizeof(PolyWord); i > 0; i--)
++ {
++ pointer[i-1] = (byte)(c & 255);
++ c >>= 8;
++ }
++#else
+ for (unsigned i = 0; i < sizeof(PolyWord); i++)
+ {
+ pointer[i] = (byte)(c & 255);
+ c >>= 8;
+ }
++#endif
+ break;
+ }
+ case 1: // Relative constant - X86 - size 4 bytes
+diff --git a/mlsource/MLCompiler/CodeTree/CODETREE_SIMPLIFIER.sml
b/mlsource/MLCompiler/CodeTree/CODETREE_SIMPLIFIER.sml
+index e66503fb..c6b449cf 100644
+--- a/mlsource/MLCompiler/CodeTree/CODETREE_SIMPLIFIER.sml
++++ b/mlsource/MLCompiler/CodeTree/CODETREE_SIMPLIFIER.sml
+@@ -1108,12 +1108,12 @@ struct
+ | (WordLogical logop, arg1, arg2 as Constnt(v2, _)) =>
+ (* Return the zero if we are anding with zero otherwise the original arg *)
+ if isShort v2 andalso toShort v2 = 0w0
+- then (case logop of LogicalAnd => arg2 | _ => arg1, decArgs,
EnvSpecNone)
++ then (case logop of LogicalAnd => CodeZero | _ => arg1, decArgs,
EnvSpecNone)
+ else (Binary{oper=oper, arg1=genArg1, arg2=genArg2}, decArgs, EnvSpecNone)
+
+ | (WordLogical logop, Constnt(v1, _), arg2) =>
+ if isShort v1 andalso toShort v1 = 0w0
+- then (case logop of LogicalAnd => arg2 | _ => arg2, decArgs,
EnvSpecNone)
++ then (case logop of LogicalAnd => CodeZero | _ => arg2, decArgs,
EnvSpecNone)
+ else (Binary{oper=oper, arg1=genArg1, arg2=genArg2}, decArgs, EnvSpecNone)
+
+ (* TODO: Constant folding of shifts. *)
diff --git a/polyml.spec b/polyml.spec
index 3fdf1bc..fe1c052 100644
--- a/polyml.spec
+++ b/polyml.spec
@@ -9,6 +9,9 @@ Summary: Poly/ML compiler and runtime system
License: LGPLv2+
URL:
http://www.polyml.org/
Source0:
https://github.com/%{name}/%{name}/archive/v%{version}/%{name}-%{version}...
+# Fixes from the upstream fixes-5.8 branch. This currently contains fixes up
+# to commit 185b1ce7aa334ba7f27c4184fda77dc6831f2e4f.
+Patch0: polyml-fixes.patch
# The standard solution to kill the libtool-induced RPATH is to edit the
# libtool script to kill it. However, that causes problems for us as we need
@@ -51,12 +54,15 @@ Runtime libraries for Poly/ML.
%prep
%autosetup -p1
-# Fix a broken assignment in the configure script
-sed -i 's/dependentlibs = ""/dependentlibs=""/' configure
-
# Fix end of line encoding
sed -i 's/\r//' documentation/main.css
+# One floating point test fails on 32-bit ARM due to rounding error. Upstream
+# is aware, but is uninterested in fixing the issue. Disable that test.
+%ifarch %{arm}
+sed -i '2iraise NotApplicable;' Tests/Succeed/Test174.ML
+%endif
+
%build
%configure --enable-shared --disable-static --with-system-libffi \
%if 0%{?__isa_bits} == 64
@@ -101,6 +107,9 @@ make check
%{_libdir}/libpolyml.so.*
%changelog
+* Sat May 18 2019 Jerry James <loganjerry(a)gmail.com> - 5.8-1
+- Add -fixes patch to fix s390x build
+
* Tue Mar 12 2019 Jerry James <loganjerry(a)gmail.com> - 5.8-1
- New upstream version
- Drop all patches; all upstreamed