130-mips.patch 2.4 KB

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