Patchwork [1/4] crosstool-ng: Patch dmalloc-5.5.2 for powerpc

login
register
mail settings
Submitter christian.braunersorensen@prevas.dk
Date Feb. 27, 2013, 8:43 a.m.
Message ID <c6cba280c4fca32b71bf0963fb5a2f110298dca6.1361954556.git.christian.braunersorensen@prevas.dk>
Download mbox | patch
Permalink /patch/223553/
State Accepted
Delegated to: Esben Haabendal
Headers show

Comments

christian.braunersorensen@prevas.dk - Feb. 27, 2013, 8:43 a.m.
From: Christian Sørensen <christian.braunersorensen@prevas.dk>

Signed-off-by: Esben Haabendal <esben.haabendal@prevas.dk>
---
 .../dmalloc-5.5.2-fix-recursion.patch                  | 18 ++++++++++++++++++
 .../crosstool-ng-1.17.0/dmalloc-5.5.2-powerpc.patch    | 15 +++++++++++++++
 recipes/crosstool-ng/crosstool-ng_1.17.0.oe            |  2 ++
 3 files changed, 35 insertions(+)
 create mode 100644 recipes/crosstool-ng/crosstool-ng-1.17.0/dmalloc-5.5.2-fix-recursion.patch
 create mode 100644 recipes/crosstool-ng/crosstool-ng-1.17.0/dmalloc-5.5.2-powerpc.patch
Esben Haabendal - Feb. 27, 2013, 3:09 p.m.
<christian.braunersorensen@prevas.dk> writes:

> From: Christian Sørensen <christian.braunersorensen@prevas.dk>
>
> Signed-off-by: Esben Haabendal <esben.haabendal@prevas.dk>
> ---
>  .../dmalloc-5.5.2-fix-recursion.patch                  | 18 ++++++++++++++++++
>  .../crosstool-ng-1.17.0/dmalloc-5.5.2-powerpc.patch    | 15 +++++++++++++++
>  recipes/crosstool-ng/crosstool-ng_1.17.0.oe            |  2 ++
>  3 files changed, 35 insertions(+)

Merged to master, thanks.

/Esben

Patch

diff --git a/recipes/crosstool-ng/crosstool-ng-1.17.0/dmalloc-5.5.2-fix-recursion.patch b/recipes/crosstool-ng/crosstool-ng-1.17.0/dmalloc-5.5.2-fix-recursion.patch
new file mode 100644
index 0000000..bd0c60a
--- /dev/null
+++ b/recipes/crosstool-ng/crosstool-ng-1.17.0/dmalloc-5.5.2-fix-recursion.patch
@@ -0,0 +1,18 @@ 
+--- crosstool-ng-1.17.0~orig/patches/dmalloc/5.5.2/130-fix-recursion.patch 	2013-01-07 14:20:25.277907402 +0000
++++ crosstool-ng-1.17.0/patches/dmalloc/5.5.2/130-fix-recursion.patch	2013-01-25 13:35:02.292399503 +0000
+@@ -0,0 +1,15 @@
++diff --git a/malloc.c b/malloc.c
++index 9a9477e..07db134 100644
++--- a/malloc.c
+++++ b/malloc.c
++@@ -1030,7 +1030,9 @@ int	dmalloc_free(const char *file, const int line, DMALLOC_PNT pnt,
++ 		     const int func_id)
++ {
++   int		ret;
++-
+++  if(NULL==pnt)
+++    return FREE_NOERROR;
+++
++   if (! dmalloc_in(file, line, 1)) {
++     if (tracking_func != NULL) {
++       tracking_func(file, line, func_id, 0, 0, pnt, NULL);
diff --git a/recipes/crosstool-ng/crosstool-ng-1.17.0/dmalloc-5.5.2-powerpc.patch b/recipes/crosstool-ng/crosstool-ng-1.17.0/dmalloc-5.5.2-powerpc.patch
new file mode 100644
index 0000000..3ffebdf
--- /dev/null
+++ b/recipes/crosstool-ng/crosstool-ng-1.17.0/dmalloc-5.5.2-powerpc.patch
@@ -0,0 +1,15 @@ 
+diff -urN crosstool-ng-1.17.0~orig/patches/dmalloc/5.5.2/131-powerpc.patch crosstool-ng-1.17.0/patches/dmalloc/5.5.2/131-powerpc.patch
+--- crosstool-ng-1.17.0~orig/patches/dmalloc/5.5.2/131-powerpc.patch	1970-01-01 01:00:00.000000000 +0100
++++ crosstool-ng-1.17.0/patches/dmalloc/5.5.2/131-powerpc.patch	2012-12-17 20:55:29.864946447 +0100
+@@ -0,0 +1,11 @@
++--- dmalloc-5.5.2/return.h~orig	2012-12-17 20:49:44.776955097 +0100
+++++ dmalloc-5.5.2/return.h	2012-12-17 20:49:58.720954747 +0100
++@@ -251,8 +251,7 @@
++ #define GET_RET_ADDR(file) \
++ do { \
++-  asm("mflr 0"); \
++-  asm("stw 0,%0" : "=g" (file)); \
+++  asm("mflr %0" : "=g" (file)); \
++ } while(0)
++
++ #endif /* __powerpc__ && __GNUC__ && !__OPTIMIZE__ */
diff --git a/recipes/crosstool-ng/crosstool-ng_1.17.0.oe b/recipes/crosstool-ng/crosstool-ng_1.17.0.oe
index e8f5ad5..37a5096 100644
--- a/recipes/crosstool-ng/crosstool-ng_1.17.0.oe
+++ b/recipes/crosstool-ng/crosstool-ng_1.17.0.oe
@@ -11,6 +11,8 @@  SRC_URI += "${SRC_URI_FIXES_BASE}/002-scripts_functions_fix_debug_shell.patch"
 SRC_URI += "file://prefix.patch"
 SRC_URI += "file://canadian-skip-cc-core.patch"
 SRC_URI += "file://dir-extract-with-copy.patch"
+SRC_URI += "file://dmalloc-5.5.2-powerpc.patch"
+SRC_URI += "file://dmalloc-5.5.2-fix-recursion.patch"
 
 # For some odd reason, ct-NG configure scripts end up setting make path
 # to just "make" and not the full path.  And even more odd, this breaks