xref: /OK3568_Linux_fs/yocto/meta-openembedded/meta-oe/recipes-devtools/dmalloc/dmalloc/130-mips.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1Patch to correctly handle the MIPS case.
2
3It was build up by Yann E. MORIN <yann.morin.1998@anciens.enib.fr> from some
4bits gathered from buildroot, which is LGPL v2.1
5License for dmalloc is:
6 * Permission to use, copy, modify, and distribute this software for
7 * any purpose and without fee is hereby granted, provided that the
8 * above copyright notice and this permission notice appear in all
9 * copies, and that the name of Gray Watson not be used in advertising
10 * or publicity pertaining to distribution of the document or software
11 * without specific, written prior permission.
12 *
13 * Gray Watson makes no representations about the suitability of the
14 * software described herein for any purpose.  It is provided "as is"
15 * without express or implied warranty.
16
17I personnaly believe that the resulting code should therefore be
18LGPL v2.1, but don't believe me, ask your lawyers!
19
20Index: dmalloc-5.5.2/return.h
21===================================================================
22--- dmalloc-5.5.2.orig/return.h
23+++ dmalloc-5.5.2/return.h
24@@ -106,26 +106,16 @@
25 /*************************************/
26
27 /*
28- * For DEC Mips machines running Ultrix
29+ * For Mips machines running Linux
30  */
31 #if __mips
32
33 /*
34- * I have no idea how to get inline assembly with the default cc.
35- * Anyone know how?
36- */
37-
38-#if 0
39-
40-/*
41  * NOTE: we assume here that file is global.
42  *
43- * $31 is the frame pointer.  $2 looks to be the return address but maybe
44- * not consistently.
45+ * $31 is the return address.
46  */
47-#define GET_RET_ADDR(file)	asm("sw $2, file")
48-
49-#endif
50+#define GET_RET_ADDR(file)	asm("sw $31, %0" : "=m" (file))
51
52 #endif /* __mips */
53
54Index: dmalloc-5.5.2/configure.ac
55===================================================================
56--- dmalloc-5.5.2.orig/configure.ac
57+++ dmalloc-5.5.2/configure.ac
58@@ -585,31 +585,7 @@ int main() { return 1; }
59 # check if the return.h macros work
60 #
61 AC_MSG_CHECKING([return.h macros work])
62-AC_RUN_IFELSE([
63-
64-#define __CONF_H__
65-#define USE_RETURN_MACROS 1
66-#define RETURN_MACROS_WORK 1
67-
68-#include "return.h"
69-
70-static void foo (void)
71-{
72-  char	*ret_addr;
73-  GET_RET_ADDR(ret_addr);
74-}
75-
76-main()
77-{
78-  foo();
79-  exit(0);
80-}
81-],
82-[ AC_DEFINE(RETURN_MACROS_WORK, 1) AC_MSG_RESULT([yes]) ],
83-[ AC_DEFINE(RETURN_MACROS_WORK, 0) AC_MSG_RESULT([no]) ],
84-[ AC_DEFINE(RETURN_MACROS_WORK, 0) AC_MSG_RESULT([no]) ]
85-)
86-
87+AC_DEFINE(RETURN_MACROS_WORK, 1)
88 ##############################################################################
89
90 #
91