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
commit 33c67fec727be5f5150745d6c2a5fedf51618be5
Author: Jerry James <loganjerry(a)gmail.com>
Date: Tue Mar 12 19:24:50 2019 -0600
New upstream version.
Also:
- Drop all patches; all upstreamed.
- Drop executable stack workarounds, now handled upstream.
diff --git a/.gitignore b/.gitignore
index fbf5f87..898a246 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1 @@
-/polyml-docs.tar.xz
-/polyml.5.5.2.tar.gz
-/v5.6.tar.gz
-/v5.7.tar.gz
-/polyml-5.7.1.tar.gz
+/polyml-*.tar.gz
diff --git a/polyml-codesize.patch b/polyml-codesize.patch
deleted file mode 100644
index ba17922..0000000
--- a/polyml-codesize.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/libpolyml/exporter.cpp b/libpolyml/exporter.cpp
-index 2ddc2f39..db392747 100644
---- a/libpolyml/exporter.cpp
-+++ b/libpolyml/exporter.cpp
-@@ -201,7 +201,7 @@ void CopyScan::initialise(bool isExport/*=true*/)
- // Much smaller minimum sizes for saved states.
- if (defaultMutSize < 1024) defaultMutSize = 1024;
- if (defaultImmSize < 4096) defaultImmSize = 4096;
-- if (defaultCodeSize < 4096) defaultImmSize = 4096;
-+ if (defaultCodeSize < 4096) defaultCodeSize = 4096;
- if (defaultNoOverSize < 4096) defaultNoOverSize = 4096;
- // Set maximum sizes as well. We may have insufficient contiguous space for
- // very large areas.
diff --git a/polyml-in-ml.patch b/polyml-in-ml.patch
deleted file mode 100644
index cfb906c..0000000
--- a/polyml-in-ml.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-diff --git a/libpolyml/processes.h b/libpolyml/processes.h
-index 63c4d226..6c95adfb 100644
---- a/libpolyml/processes.h
-+++ b/libpolyml/processes.h
-@@ -140,8 +140,8 @@ public:
- virtual void addProfileCount(POLYUNSIGNED words) = 0;
-
- // Functions called before and after an RTS call.
-- virtual void PreRTSCall(void) {}
-- virtual void PostRTSCall(void) {}
-+ virtual void PreRTSCall(void) { inML = false; }
-+ virtual void PostRTSCall(void) { inML = true; }
-
- SaveVec saveVec;
- PolyWord *allocPointer; // Allocation pointer - decremented towards...
-diff --git a/libpolyml/x86_dep.cpp b/libpolyml/x86_dep.cpp
-index 086a7998..1f602b82 100644
---- a/libpolyml/x86_dep.cpp
-+++ b/libpolyml/x86_dep.cpp
-@@ -223,10 +223,10 @@ public:
- { add_count(this, assemblyInterface.stackPtr[0].AsCodePtr(), words); }
-
- // PreRTSCall: After calling from ML to the RTS we need to save the current heap
pointer
-- virtual void PreRTSCall(void) { SaveMemRegisters(); }
-+ virtual void PreRTSCall(void) { TaskData::PreRTSCall(); SaveMemRegisters(); }
- // PostRTSCall: Before returning we need to restore the heap pointer.
- // If there has been a GC in the RTS call we need to create a new heap area.
-- virtual void PostRTSCall(void) { SetMemRegisters(); }
-+ virtual void PostRTSCall(void) { SetMemRegisters(); TaskData::PostRTSCall(); }
-
- virtual void CopyStackFrame(StackObject *old_stack, POLYUNSIGNED old_length,
StackObject *new_stack, POLYUNSIGNED new_length);
-
diff --git a/polyml-mutable.patch b/polyml-mutable.patch
deleted file mode 100644
index 87c32d5..0000000
--- a/polyml-mutable.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff --git a/libpolyml/gc_share_phase.cpp b/libpolyml/gc_share_phase.cpp
-index 49cc9cd0..c60b3f8d 100644
---- a/libpolyml/gc_share_phase.cpp
-+++ b/libpolyml/gc_share_phase.cpp
-@@ -237,6 +237,16 @@ void GetSharing::MarkAsScanning(PolyObject *obj)
-
- void GetSharing::Completed(PolyObject *obj)
- {
-+ // We mustn't include cells in the permanent area.
-+ // We scan the permanent mutable areas for local addresses
-+ // but we mustn't add the cells themselves. Normally they
-+ // will be mutable so would be ignored but cells that have been
-+ // locked will now be immutable. The test in TestForScan is bypassed
-+ // by ScanAddressesInRegion.
-+ PolyWord *lengthWord = ((PolyWord*)obj) - 1;
-+ if (gMem.LocalSpaceForAddress(lengthWord) == 0)
-+ return;
-+
- POLYUNSIGNED L = obj->LengthWord();
- // We have tables for word objects and byte objects
- // We chain entries together using the length word so it
-diff --git a/libpolyml/scanaddrs.cpp b/libpolyml/scanaddrs.cpp
-index d1bd9769..be7650d9 100644
---- a/libpolyml/scanaddrs.cpp
-+++ b/libpolyml/scanaddrs.cpp
-@@ -373,6 +373,9 @@ void RecursiveScan::ScanAddressesInObject(PolyObject *obj,
POLYUNSIGNED lengthWo
- if (baseAddr == endWord)
- {
- // We have done everything except possibly firstWord and secondWord.
-+ // Note: Unfortunately the way that ScanAddressesInRegion works means that
-+ // we call Completed on the addresses of cells in the permanent areas
without
-+ // having called TestForScan.
- Completed(obj);
- if (secondWord != 0)
- {
diff --git a/polyml-thread-count.patch b/polyml-thread-count.patch
deleted file mode 100644
index 4c4060c..0000000
--- a/polyml-thread-count.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/libpolyml/processes.cpp b/libpolyml/processes.cpp
-index 0c89bbd2..53e0d764 100644
---- a/libpolyml/processes.cpp
-+++ b/libpolyml/processes.cpp
-@@ -926,8 +926,6 @@ void Processes::ThreadExit(TaskData *taskData)
- pthread_setspecific(tlsId, 0);
- #endif
-
-- globalStats.decCount(PSC_THREADS);
--
- if (singleThreaded) finish(0);
-
- schedLock.Lock();
diff --git a/polyml.spec b/polyml.spec
index 2a8eca7..3fdf1bc 100644
--- a/polyml.spec
+++ b/polyml.spec
@@ -2,21 +2,13 @@
%undefine _hardened_build
Name: polyml
-Version: 5.7.1
-Release: 6%{?dist}
+Version: 5.8
+Release: 1%{?dist}
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}...
-#
https://github.com/polyml/polyml/commit/86c52cbd8f6d292c0708d04379d048d7b...
-Patch0: %{name}-codesize.patch
-#
https://github.com/polyml/polyml/commit/3f75961b36601451a464b2eb22fb54d4a...
-Patch1: %{name}-in-ml.patch
-#
https://github.com/polyml/polyml/commit/31643fd67f474f4e741ffd9bfcf5b1cc2...
-Patch2: %{name}-mutable.patch
-#
https://github.com/polyml/polyml/commit/b3d1ff33a4b486a29e590cd4bee4bff35...
-Patch3: %{name}-thread-count.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
@@ -59,21 +51,20 @@ 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
%build
-# Some hand-coded assembler is included. Because it does not contain an
-# explicit section marker stating that the stack section does not need the
-# executable bit, gas assumes that it does. The linker then propagates the
-# execstack flag into the executables, which is bad news for people running
-# SELinux. The execstack flag is not really needed, so we go through the
-# contortions below to keep it off.
%configure --enable-shared --disable-static --with-system-libffi \
+%if 0%{?__isa_bits} == 64
+ --enable-compact32bit \
+%endif
CPPFLAGS="-D_GNU_SOURCE" \
- CFLAGS="${RPM_OPT_FLAGS} -fno-strict-aliasing -Wa,--noexecstack" \
- CXXFLAGS="${RPM_OPT_FLAGS} -fno-strict-aliasing -Wa,--noexecstack" \
- CCASFLAGS="-Wa,--noexecstack" LDFLAGS="$RPM_LD_FLAGS
-Wl,-z,noexecstack"
+ CFLAGS="${RPM_OPT_FLAGS} -fno-strict-aliasing" \
+ CXXFLAGS="${RPM_OPT_FLAGS} -fno-strict-aliasing"
make %{?_smp_mflags}
chrpath -d .libs/poly
chrpath -d .libs/polyimport
@@ -89,8 +80,6 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
%check
make check
-%ldconfig_scriptlets libs
-
%files
%{_bindir}/poly
%{_bindir}/polyc
@@ -112,6 +101,11 @@ make check
%{_libdir}/libpolyml.so.*
%changelog
+* Tue Mar 12 2019 Jerry James <loganjerry(a)gmail.com> - 5.8-1
+- New upstream version
+- Drop all patches; all upstreamed
+- Drop executable stack workarounds, now handled upstream
+
* Sat Feb 02 2019 Fedora Release Engineering <releng(a)fedoraproject.org> - 5.7.1-6
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
diff --git a/sources b/sources
index 2931aa0..cfecc98 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (polyml-5.7.1.tar.gz) =
0b597f2fc9a68b764d4621e4e6b9c69083181bdfae66f53d0033bfc9661b9c42d252a42a72123245e8a55176a673d5343d6dd7936ae806d330b5e2b81f35e4d6
+SHA512 (polyml-5.8.tar.gz) =
50baed79b50b14bd87acc637de93fd6d0f05e61fe0f03682a12a1d2c5f382313488d48f84b49ad915b01acc5a3a5769fb05fcaa7b24499c56402ddd3ba393930