[polyml] 06/13: Add support for X32

James Clarke jrtc27-guest at moszumanska.debian.org
Sat Mar 12 20:28:24 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 74f878b4b91278cc8e9901e80032588f36b715b9
Author: James Clarke <jrtc27 at jrtc27.com>
Date:   Fri Mar 11 16:55:22 2016 +0000

    Add support for X32
---
 debian/changelog        |  1 +
 debian/patches/series   |  1 +
 debian/patches/x32.diff | 81 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 83 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 73ab4c7..408e49a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@ polyml (5.6-3) UNRELEASED; urgency=low
     - alpha.diff: Add support for alpha
     - m68k.diff: Add support for m68k
     - mips64.diff: Add support for mips64/mips64el
+    - x32.diff: Add support for x32
 
  -- James Clarke <jrtc27 at jrtc27.com>  Tue, 02 Feb 2016 21:15:49 +0000
 
diff --git a/debian/patches/series b/debian/patches/series
index 7708fe7..c48e2cf 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -13,3 +13,4 @@ use-polyunsigned-consistently-for-stream-ids.diff
 alpha.diff
 m68k.diff
 mips64.diff
+x32.diff
diff --git a/debian/patches/x32.diff b/debian/patches/x32.diff
new file mode 100644
index 0000000..bb6ab3f
--- /dev/null
+++ b/debian/patches/x32.diff
@@ -0,0 +1,81 @@
+Description: Add support for x32 ABI
+Author: James Clarke <jrtc27 at jrtc27.com>
+Forwarded: https://github.com/polyml/polyml/pull/36
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/config.h.in
++++ b/config.h.in
+@@ -590,6 +590,9 @@
+ /* Define if the host is a Sparc (32-bit) */
+ #undef HOSTARCHITECTURE_SPARC
+ 
++/* Define if the host is an X86 (32-bit ABI, 64-bit processor) */
++#undef HOSTARCHITECTURE_X32
++
+ /* Define if the host is an X86 (32-bit) */
+ #undef HOSTARCHITECTURE_X86
+ 
+--- a/configure.ac
++++ b/configure.ac
+@@ -420,8 +420,13 @@
+             polyarch=i386
+             ;;
+       x86_64* | amd64*)
+-            AC_DEFINE([HOSTARCHITECTURE_X86_64], [1], [Define if the host is an X86 (64-bit)])
+-            polyarch=x86_64
++            if test X"$ac_cv_sizeof_voidp" = X8; then
++                AC_DEFINE([HOSTARCHITECTURE_X86_64], [1], [Define if the host is an X86 (64-bit)])
++                polyarch=x86_64
++            else
++                AC_DEFINE([HOSTARCHITECTURE_X32], [1], [Define if the host is an X86 (32-bit ABI, 64-bit processor)])
++                polyarch=interpret
++            fi
+             ;;
+       sparc*)
+             AC_DEFINE([HOSTARCHITECTURE_SPARC], [1], [Define if the host is a Sparc (32-bit)])
+--- a/libpolyml/elfexport.cpp
++++ b/libpolyml/elfexport.cpp
+@@ -220,7 +220,8 @@
+             }
+         }
+         break;
+-#if(defined(HOSTARCHITECTURE_X86) || defined(HOSTARCHITECTURE_X86_64))
++#if(defined(HOSTARCHITECTURE_X86) || defined(HOSTARCHITECTURE_X86_64) || \
++        defined(HOSTARCHITECTURE_X32))
+ #ifdef HOSTARCHITECTURE_X86
+ #define R_PC_RELATIVE R_386_PC32
+ #else
+@@ -402,6 +403,10 @@
+     fhdr.e_machine = EM_X86_64;
+     directReloc = R_X86_64_64;
+     useRela = true;
++#elif defined(HOSTARCHITECTURE_X32)
++    fhdr.e_machine = EM_X86_64;
++    directReloc = R_X86_64_32;
++    useRela = true;
+ #elif defined(HOSTARCHITECTURE_ARM)
+ #ifndef EF_ARM_EABI_VER4 
+ #define EF_ARM_EABI_VER4     0x04000000
+--- a/libpolyml/quick_gc.cpp
++++ b/libpolyml/quick_gc.cpp
+@@ -137,7 +137,7 @@
+     POLYUNSIGNED result = InterlockedCompareExchange(address, update, testVal);
+     return result == testVal;
+ # endif
+-#elif(defined(HOSTARCHITECTURE_X86) && defined(__GNUC__))
++#elif((defined(HOSTARCHITECTURE_X86) || defined(HOSTARCHITECTURE_X32)) && defined(__GNUC__))
+     POLYUNSIGNED result;
+     __asm__ __volatile__ (
+         "lock; cmpxchgl %1,%2"
+--- a/libpolyml/realconv.cpp
++++ b/libpolyml/realconv.cpp
+@@ -220,7 +220,8 @@
+ 
+ #if !defined(IEEE_8087) && ! defined(IEEE_MC68k)
+ #if defined(_WIN32) || defined(HOSTARCHITECTURE_X86) || defined (__i386__) || defined (_M_IX86) || \
+-        defined (vax) || defined (__alpha) || defined(HOSTARCHITECTURE_X86_64)
++        defined (vax) || defined (__alpha) || defined(HOSTARCHITECTURE_X86_64) || \
++        defined(HOSTARCHITECTURE_X32)
+ #define IEEE_8087
+ #else
+ #define IEEE_MC68k

-- 
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