[eso-midas] 01/03: Fix FTBS on s390x (64 bit big endian problem)
Ole Streicher
olebole-guest at moszumanska.debian.org
Fri Jun 6 08:08:05 UTC 2014
This is an automated email from the git hooks/post-receive script.
olebole-guest pushed a commit to branch debian
in repository eso-midas.
commit 87e0b689bad3abca809815d3202b7f605fa31f50
Author: Ole Streicher <debian at liska.ath.cx>
Date: Fri Jun 6 09:22:10 2014 +0200
Fix FTBS on s390x (64 bit big endian problem)
---
debian/changelog | 1 +
debian/patches/fix_swapint.patch | 33 +++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 35 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 7711f0f..8be1197 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ eso-midas (13.09pl1.2+dfsg-3) UNRELEASED; urgency=low
* include libgmidas shared library
* Fix (another) FTBS on kfreebsd
+ * Fix FTBS on s390x (64 bit big endian problem)
-- Ole Streicher <debian at liska.ath.cx> Thu, 05 Jun 2014 14:04:51 +0200
diff --git a/debian/patches/fix_swapint.patch b/debian/patches/fix_swapint.patch
new file mode 100644
index 0000000..6ca64d9
--- /dev/null
+++ b/debian/patches/fix_swapint.patch
@@ -0,0 +1,33 @@
+Author: Ole Streicher <debian at liska.ath.cx>
+Description: For determination of endianess, use <stdint.h>
+ The original code uses "long" for the determination of swapping in
+ integer. This works fine on 32 bit computers, and accidently works
+ on 64 bit little endian computers. 64 bit big endian computers (s390)
+ fail here. Therefore, integers with deterministic lengths (C99) are used.
+--- a/system/machine/computer.c
++++ b/system/machine/computer.c
+@@ -84,6 +84,8 @@
+ #define DEBUG 0 /* Switch to 1 to get hexa patterns */
+ #endif
+
++#include <stdint.h>
++
+ double ldexp();
+
+ static char c[80]; /* ... Must be aligned ... */
+@@ -278,13 +280,13 @@
+ /* Check Swapping */
+
+ i = ('1'<<bitsperbyte) | '2';
+- *(short *)c = i, c[2] = 0;
++ *(int16_t *)c = i, c[2] = 0;
+ printf("\n#define SWAPSHORT\t%s\n", c);
+
+ i = ('1'<<bitsperbyte) | '2';
+ i = (i<<bitsperbyte) | '3';
+ i = (i<<bitsperbyte) | '4';
+- *(long *)c = i, c[4] = 0;
++ *(int32_t *)c = i, c[4] = 0;
+ printf("#define SWAPINT\t\t%s\n", c);
+
+ /* Find out Dynamic range of Floating-Point */
diff --git a/debian/patches/series b/debian/patches/series
index e0828e4..bfb2735 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -12,3 +12,4 @@ dfsg-free-msg_h.patch
fix_manpages.patch
fix_missing_haddr.patch
fix_POSIX_VDISABLE.patch
+fix_swapint.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/eso-midas.git
More information about the debian-science-commits
mailing list