From 6f36f3a32a517712df399c326528febf60de21e3 Mon Sep 17 00:00:00 2001 From: Stefan Fiedler Date: Fri, 2 Nov 2007 13:28:13 +0000 Subject: [PATCH] Stefan Fiedler: calltree: same patch as for cdrtools cdrdao: same patch as for cdrtools [2007100820170963100] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@8774 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- package/base/cdrdao/redefine_malloc.patch | 41 +++++++++++++++++++ .../clifford/calltree/redefine_malloc.patch | 41 +++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 package/base/cdrdao/redefine_malloc.patch create mode 100644 package/clifford/calltree/redefine_malloc.patch diff --git a/package/base/cdrdao/redefine_malloc.patch b/package/base/cdrdao/redefine_malloc.patch new file mode 100644 index 000000000..85cf9b3e6 --- /dev/null +++ b/package/base/cdrdao/redefine_malloc.patch @@ -0,0 +1,41 @@ +This patch exists to avoid an infinite recursion in the fl_wrapper. +fl_wrapper catches the _exit() call in the redefined malloc() and +indirectly calls malloc() again... not ideal. + +--- ./scsilib/conf/configure 2006-09-09 10:24:32.000000000 +0200 ++++ ./scsilib/conf/configure 2006-09-09 09:33:07.000000000 +0200 +@@ -9362,27 +9362,24 @@ + #include "confdefs.h" + + static int mcalled; +-char * ++void * + malloc(s) +- int s; ++ size_t s; + { +- extern char *sbrk(); +- + mcalled++; +- _exit(0); +- return (sbrk(s)); ++ return calloc(1, s); + } + +-free(p) char *p;{} +- + main() + { + #ifdef HAVE_STRDUP +- strdup("aaa"); ++ char * pc = strdup("aaa"); ++ if (pc) free(pc); + #else + exit(0); + #endif +- exit(1);} ++ exit(mcalled == 0); ++} + EOF + if { (eval echo configure:9388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then diff --git a/package/clifford/calltree/redefine_malloc.patch b/package/clifford/calltree/redefine_malloc.patch new file mode 100644 index 000000000..fc62158e5 --- /dev/null +++ b/package/clifford/calltree/redefine_malloc.patch @@ -0,0 +1,41 @@ +This patch exists to avoid an infinite recursion in the fl_wrapper. +fl_wrapper catches the _exit() call in the redefined malloc() and +indirectly calls malloc() again... not ideal. + +--- cdrtools-2.01/conf/configure 2006-09-09 10:24:32.000000000 +0200 ++++ cdrtools-2.01/conf/configure 2006-09-09 09:33:07.000000000 +0200 +@@ -9362,27 +9362,24 @@ + #include "confdefs.h" + + static int mcalled; +-char * ++void * + malloc(s) +- int s; ++ size_t s; + { +- extern char *sbrk(); +- + mcalled++; +- _exit(0); +- return (sbrk(s)); ++ return calloc(1, s); + } + +-free(p) char *p;{} +- + main() + { + #ifdef HAVE_STRDUP +- strdup("aaa"); ++ char * pc = strdup("aaa"); ++ if (pc) free(pc); + #else + exit(0); + #endif +- exit(1);} ++ exit(mcalled == 0); ++} + EOF + if { (eval echo configure:9388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then