[liblucy-perl] 01/02: add patch from Dejan Latinovic fixing misaligned double access on mips causing FTBFS

Damyan Ivanov dmn at moszumanska.debian.org
Sat Sep 27 12:48:21 UTC 2014


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

dmn pushed a commit to branch master
in repository liblucy-perl.

commit 764c04adf7e9e5ef6061376e8a100420f29679c0
Author: Damyan Ivanov <dmn at debian.org>
Date:   Sat Sep 27 12:42:49 2014 +0000

    add patch from Dejan Latinovic fixing misaligned double access on mips causing FTBFS
    
    Closes: #762958
---
 debian/patches/mips-unaligned-access.patch | 34 ++++++++++++++++++++++++++++++
 debian/patches/series                      |  1 +
 2 files changed, 35 insertions(+)

diff --git a/debian/patches/mips-unaligned-access.patch b/debian/patches/mips-unaligned-access.patch
new file mode 100644
index 0000000..66e8795
--- /dev/null
+++ b/debian/patches/mips-unaligned-access.patch
@@ -0,0 +1,34 @@
+Description: fix misaligned double access on mips
+ Mips architecture allows accessing doubles only on 8-byte (sizeof(double))
+ aligned addresses. The code tries to align these on sizeof(void*) which is 4
+ on mips.
+Author: Dejan Latinovic <Dejan.Latinovic at imgtec.com>
+Acked-By: Damyan Ivanov <dmn at debian.org>
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=762958
+Forwarded: https://rt.cpan.org/Ticket/Display.html?id=99171
+Bug: https://rt.cpan.org/Ticket/Display.html?id=99171
+
+--- a/core/Lucy/Util/MemoryPool.c
++++ b/core/Lucy/Util/MemoryPool.c
+@@ -24,12 +24,19 @@ S_init_arena(MemoryPool *self, size_t am
+ 
+ #define DEFAULT_BUF_SIZE 0x100000 // 1 MiB
+ 
++// On MIPS, access to double values need to be 8-bytes aligned.
++#if defined (__mips__)
++#define BYTE_ALIGNED sizeof(double);
++#else
++#define BYTE_ALIGNED sizeof(void*);
++#endif
++
+ // Enlarge amount so pointers will always be aligned.
+ #define INCREASE_TO_WORD_MULTIPLE(_amount) \
+     do { \
+-        const size_t _remainder = _amount % sizeof(void*); \
++        const size_t _remainder = _amount % BYTE_ALIGNED; \
+         if (_remainder) { \
+-            _amount += sizeof(void*); \
++            _amount += BYTE_ALIGNED; \
+             _amount -= _remainder; \
+         } \
+     } while (0)
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..2f91c06
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+mips-unaligned-access.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/liblucy-perl.git



More information about the Pkg-perl-cvs-commits mailing list