[berkeley-abc] 01/02: Added patch fixing memory alignment issue

Ruben Undheim rubund-guest at moszumanska.debian.org
Tue Feb 10 22:32:17 UTC 2015


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

rubund-guest pushed a commit to branch master
in repository berkeley-abc.

commit f371c7e2df7ea1f540e5b60694ddb428b2ebba50
Author: Ruben Undheim <ruben.undheim at gmail.com>
Date:   Tue Feb 10 23:28:49 2015 +0100

    Added patch fixing memory alignment issue
---
 debian/patches/04_memory_alignment_fix.patch | 55 ++++++++++++++++++++++++++++
 debian/patches/series                        |  1 +
 2 files changed, 56 insertions(+)

diff --git a/debian/patches/04_memory_alignment_fix.patch b/debian/patches/04_memory_alignment_fix.patch
new file mode 100644
index 0000000..e1ba8d5
--- /dev/null
+++ b/debian/patches/04_memory_alignment_fix.patch
@@ -0,0 +1,55 @@
+Description: Backporting a fix which causes crashes on certain architectures.
+ There were some memory alignment problems
+Author: Clifford Wolf <clifford at clifford.at>
+Forwarded: Came from upstream - therefore no need
+Index: berkeley-abc/Makefile
+===================================================================
+--- berkeley-abc.orig/Makefile	2015-02-10 23:23:32.700004407 +0100
++++ berkeley-abc/Makefile	2015-02-10 23:24:35.040004937 +0100
+@@ -45,6 +45,9 @@
+ OPTFLAGS  ?= -g -O #-DABC_NAMESPACE=xxx
+ 
+ CFLAGS   += -Wall -Wno-unused-function -Wno-write-strings -Wno-sign-compare $(OPTFLAGS) $(ARCHFLAGS) -Isrc
++ifneq ($(findstring arm,$(shell uname -m)),)
++	CFLAGS += -DABC_MEMALIGN=4
++endif
+ 
+ # Set -Wno-unused-bug-set-variable for GCC 4.6.0 and greater only
+ ifneq ($(or $(findstring gcc,$(CC)),$(findstring g++,$(CC))),)
+Index: berkeley-abc/src/aig/aig/aigMem.c
+===================================================================
+--- berkeley-abc.orig/src/aig/aig/aigMem.c	2015-02-10 23:19:40.828002437 +0100
++++ berkeley-abc/src/aig/aig/aigMem.c	2015-02-10 23:26:39.164005992 +0100
+@@ -161,6 +161,10 @@
+ char * Aig_MmFixedEntryFetch( Aig_MmFixed_t * p )
+ {
+     char * pTemp;
++#ifdef ABC_MEMALIGN
++    // extend size to max alignment
++    nBytes += (ABC_MEMALIGN - nBytes % ABC_MEMALIGN) % ABC_MEMALIGN;
++#endif
+     int i;
+ 
+     // check if there are still free entries
+@@ -535,6 +539,10 @@
+ {
+     if ( nBytes == 0 )
+         return NULL;
++#ifdef ABC_MEMALIGN
++    // extend size to max alignment
++    nBytes += (ABC_MEMALIGN - nBytes % ABC_MEMALIGN) % ABC_MEMALIGN;
++#endif
+     if ( nBytes > p->nMapSize )
+     {
+         if ( p->nChunks == p->nChunksAlloc )
+@@ -564,6 +572,10 @@
+ {
+     if ( nBytes == 0 )
+         return;
++#ifdef ABC_MEMALIGN
++    // extend size to max alignment
++    nBytes += (ABC_MEMALIGN - nBytes % ABC_MEMALIGN) % ABC_MEMALIGN;
++#endif
+     if ( nBytes > p->nMapSize )
+     {
+ //        ABC_FREE( pEntry );
diff --git a/debian/patches/series b/debian/patches/series
index 94981b3..bbd701c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 remove_bzlib_convenience.patch
 remove_zlib_convenience.patch
 cflags_ldflags.patch
+04_memory_alignment_fix.patch

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



More information about the debian-science-commits mailing list