new file mode 100644
@@ -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 (! dmalloc_in(file, line, 1)) {
++ if (tracking_func != NULL) {
++ tracking_func(file, line, func_id, 0, 0, pnt, NULL);
new file mode 100644
@@ -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)); \
++ } while(0)
++
++ #endif /* __powerpc__ && __GNUC__ && !__OPTIMIZE__ */
@@ -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