[polyml] 02/03: Backport MIPS, 64-bit PowerPC and 'make check' support

James Clarke jrtc27-guest at moszumanska.debian.org
Sun Jan 24 19:48:29 UTC 2016


This is an automated email from the git hooks/post-receive script.

jrtc27-guest pushed a commit to branch master
in repository polyml.

commit ed14c8916e4c4339ccb0c1f39005f0ca02bb00d4
Author: James Clarke <jrtc27 at jrtc27.com>
Date:   Sun Jan 24 13:44:59 2016 +0000

    Backport MIPS, 64-bit PowerPC and 'make check' support
---
 debian/changelog                   |  8 ++++++
 debian/patches/make-check.diff     | 18 ++++++++++++
 debian/patches/mips.diff           | 57 ++++++++++++++++++++++++++++++++++++++
 debian/patches/mipsel.diff         | 17 ++++++++++++
 debian/patches/pexport-endian.diff | 34 +++++++++++++++++++++++
 debian/patches/ppc64.diff          | 44 +++++++++++++++++++++++++++++
 debian/patches/series              |  5 ++++
 7 files changed, 183 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 7aa05c1..6bc6682 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,14 @@
 polyml (5.5.2-4) UNRELEASED; urgency=medium
 
   * Take over as uploader
+  * New patches:
+    - make-check.diff: Backport upstream's fix so 'make check' runs the
+      regression test suite
+    - mips.diff: Backport upstream's support for mips
+    - mipsel.diff: Backport upstream's support for mipsel
+    - pexport-endian.diff: Backport upstream's fix for big-endian
+      architectures
+    - ppc64.diff: Backport upstream's support for ppc64 and ppc64el
 
  -- James Clarke <jrtc27 at jrtc27.com>  Wed, 20 Jan 2016 22:01:47 +0000
 
diff --git a/debian/patches/make-check.diff b/debian/patches/make-check.diff
new file mode 100644
index 0000000..e5df810
--- /dev/null
+++ b/debian/patches/make-check.diff
@@ -0,0 +1,18 @@
+Description: Use conventional check rule in Makefile for running test suite
+Author: James Clarke <jrtc27 at jrtc27.com>
+Forwarded: https://github.com/polyml/polyml/pull/13
+Applied-Upstream: https://github.com/polyml/polyml/commit/e6662a6ef6f4ebcdd1093f2d80b2884335d8cf2b
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -127,6 +127,8 @@
+ 	rm -f *.obj polytemp.txt polyc
+ 
+ # Run tests
+-tests: all
++check-local: all
+ 	echo "val () = use \"$(srcdir)/Tests/RunTests\"; val () = OS.Process.exit(if runTests \"$(srcdir)/Tests\" then OS.Process.success else OS.Process.failure):unit;" | ./poly
+ 
++# Retain this target for backwards compatibility
++tests: check
diff --git a/debian/patches/mips.diff b/debian/patches/mips.diff
new file mode 100644
index 0000000..004ade8
--- /dev/null
+++ b/debian/patches/mips.diff
@@ -0,0 +1,57 @@
+Description: Add support for Mips.
+Origin: upstream, https://github.com/polyml/polyml/commit/468c0b5882f1c44fbf188760bff07c1fc32a6769
+Author: David Matthews <dm at prolingua.co.uk>
+---
+--- a/config.h.in
++++ b/config.h.in
+@@ -557,6 +557,9 @@
+ /* Define if the host is Itanium */
+ #undef HOSTARCHITECTURE_IA64
+ 
++/* Define if the host is Mips (32-bit) */
++#undef HOSTARCHITECTURE_MIPS
++
+ /* Define if the host is a Power PC (32 bit) */
+ #undef HOSTARCHITECTURE_PPC
+ 
+--- a/configure
++++ b/configure
+@@ -21318,6 +21318,12 @@
+ 
+             polyarch=interpret
+         ;;
++      mips)
++
++$as_echo "#define HOSTARCHITECTURE_MIPS 1" >>confdefs.h
++
++             polyarch=interpret
++        ;;
+       *) as_fn_error $? "Poly/ML is not supported for this architecture" "$LINENO" 5 ;;
+ esac
+ 
+--- a/configure.ac
++++ b/configure.ac
+@@ -420,6 +420,10 @@
+             AC_DEFINE([HOSTARCHITECTURE_IA64], [1], [Define if the host is Itanium])
+             polyarch=interpret
+         ;;
++      mips)
++            AC_DEFINE([HOSTARCHITECTURE_MIPS], [1], [Define if the host is Mips (32-bit)])
++             polyarch=interpret
++        ;;
+       *) AC_MSG_ERROR([Poly/ML is not supported for this architecture]) ;;
+ esac
+ 
+--- a/libpolyml/elfexport.cpp
++++ b/libpolyml/elfexport.cpp
+@@ -352,6 +352,10 @@
+     fhdr.e_machine = EM_AARCH64;
+     directReloc = R_AARCH64_ABS64;
+     useRela = true;
++#elif defined(HOSTARCHITECTURE_MIPS)
++    fhdr.e_machine = EM_MIPS;
++    directReloc = R_MIPS_32;
++    useRela = true;
+ #else
+ #error "No support for exporting on this architecture"
+ #endif
diff --git a/debian/patches/mipsel.diff b/debian/patches/mipsel.diff
new file mode 100644
index 0000000..5fa56fa
--- /dev/null
+++ b/debian/patches/mipsel.diff
@@ -0,0 +1,17 @@
+Description: Add support for little-endian MIPS
+Author: James Clarke <jrtc27 at jrtc27.com>
+Forwarded: https://github.com/polyml/polyml/pull/14
+Applied-Upstream: https://github.com/polyml/polyml/commit/20c792f27042b24a5263cdcdd78f9732ea5e63d8
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/configure.ac
++++ b/configure.ac
+@@ -420,7 +420,7 @@
+             AC_DEFINE([HOSTARCHITECTURE_IA64], [1], [Define if the host is Itanium])
+             polyarch=interpret
+         ;;
+-      mips)
++      mips*)
+             AC_DEFINE([HOSTARCHITECTURE_MIPS], [1], [Define if the host is Mips (32-bit)])
+              polyarch=interpret
+         ;;
diff --git a/debian/patches/pexport-endian.diff b/debian/patches/pexport-endian.diff
new file mode 100644
index 0000000..2cee9e2
--- /dev/null
+++ b/debian/patches/pexport-endian.diff
@@ -0,0 +1,34 @@
+Description: Rebuild byte offset when importing code segments.
+ The byte count in a code segment is in host byte order.  When importing the pre-compiled
+ compiler it needs to be reset if the endian-ness differs from the machine that wrote it.
+ This is only an issue for interpreted code.
+Origin: backport, https://github.com/polyml/polyml/commit/5d4cf0d219a26ce052d48c7c89ce9c484fff0af7
+Author: David Matthews <dm at prolingua.co.uk>
+---
+--- a/libpolyml/pexport.cpp
++++ b/libpolyml/pexport.cpp
+@@ -2,7 +2,7 @@
+     Title:     Export and import memory in a portable format
+     Author:    David C. J. Matthews.
+ 
+-    Copyright (c) 2006-7 David C. J. Matthews
++    Copyright (c) 2006-7, 2016 David C. J. Matthews
+ 
+ 
+     This library is free software; you can redistribute it and/or
+@@ -827,6 +827,15 @@
+                         do ch = getc(f); while (ch == ' ');
+                     }
+                 }
++                // Adjust the byte count.  This is only necessary when importing the interpreted
++                // code into a machine with a different endian-ness from the exporter.
++                {
++                    POLYUNSIGNED l = 0;
++                    while (l < length && p->Get(l) != PolyWord::FromUnsigned(0)) l++;
++                    ASSERT(l < length);
++                    l++;
++                    p->Set(l, PolyWord::FromUnsigned(l*sizeof(PolyWord)));
++                }
+                 break;
+             }
+ 
diff --git a/debian/patches/ppc64.diff b/debian/patches/ppc64.diff
new file mode 100644
index 0000000..15cedc6
--- /dev/null
+++ b/debian/patches/ppc64.diff
@@ -0,0 +1,44 @@
+Description: Added support for 64-bit PowerPC
+Author: James Clarke <jrtc27 at jrtc27.com>
+Forwarded: https://github.com/polyml/polyml/pull/12
+Applied-Upstream: https://github.com/polyml/polyml/commit/80bc4443a26a491796753ec2c4af4a5447cbee8e
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/config.h.in
++++ b/config.h.in
+@@ -560,6 +560,9 @@
+ /* Define if the host is a Power PC (32 bit) */
+ #undef HOSTARCHITECTURE_PPC
+ 
++/* Define if the host is a Power PC (64 bit) */
++#undef HOSTARCHITECTURE_PPC64
++
+ /* Define if the host is a Sparc (32 bit) */
+ #undef HOSTARCHITECTURE_SPARC
+ 
+--- a/configure.ac
++++ b/configure.ac
+@@ -400,6 +400,10 @@
+             AC_DEFINE([HOSTARCHITECTURE_SPARC], [1], [Define if the host is a Sparc (32 bit)])
+             polyarch=interpret
+             ;;
++      powerpc64* | ppc64*)
++            AC_DEFINE([HOSTARCHITECTURE_PPC64], [1], [Define if the host is a Power PC (64 bit)])
++            polyarch=interpret
++            ;;
+       power* | ppc*)
+             AC_DEFINE([HOSTARCHITECTURE_PPC], [1], [Define if the host is a Power PC (32 bit)])
+             polyarch=interpret
+--- a/libpolyml/elfexport.cpp
++++ b/libpolyml/elfexport.cpp
+@@ -314,6 +314,10 @@
+     fhdr.e_machine = EM_PPC;
+     directReloc = R_PPC_ADDR32;
+     useRela = true;
++#elif defined(HOSTARCHITECTURE_PPC64)
++    fhdr.e_machine = EM_PPC64;
++    directReloc = R_PPC64_ADDR64;
++    useRela = true;
+ #elif defined(HOSTARCHITECTURE_SPARC)
+     fhdr.e_machine = EM_SPARC;
+     directReloc = R_SPARC_32;
diff --git a/debian/patches/series b/debian/patches/series
index 467ccee..4e588e9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,8 @@
 polyc.1-fix.diff
 arm64.diff
 noexec-stack.diff
+ppc64.diff
+mips.diff
+pexport-endian.diff
+make-check.diff
+mipsel.diff

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/polyml.git



More information about the debian-science-commits mailing list