0001-configure-fix-build-on-mips.patch 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. From af6adb3f5f05be4faa88a5aa83296c388c8085e7 Mon Sep 17 00:00:00 2001
  2. From: "Yann E. MORIN" <yann.morin.1998@free.fr>
  3. Date: Wed, 8 Feb 2023 12:30:10 +0100
  4. Subject: [PATCH] configure: fix build on mips
  5. This patch is a historical baggage that Buildroot has carried for ages
  6. (since 2006), and the reason for it are notentirely clear.
  7. Since dmalloc is pretty tricky, and as this patch has not been
  8. identified as causing issues, we keep it; we just add the configure.ac
  9. patchlet to match the one in configure.
  10. As for the title, the original patch was named dmalloc-mips.patch, so
  11. presumably it fixes some mips issue; let's title the commit that way.
  12. [Fabrice: Updated for 5.6.5]
  13. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  14. [yann.morin.1998@free.fr: make it a git-formatted patch]
  15. Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
  16. ---
  17. configure | 4 ++--
  18. configure.ac | 2 +-
  19. return.h | 16 +++-------------
  20. 3 files changed, 6 insertions(+), 16 deletions(-)
  21. diff --git a/configure b/configure
  22. index d52a1e8..c18dfb2 100755
  23. --- a/configure
  24. +++ b/configure
  25. @@ -5413,8 +5413,8 @@ fi
  26. { $as_echo "$as_me:${as_lineno-$LINENO}: checking return.h macros work" >&5
  27. $as_echo_n "checking return.h macros work... " >&6; }
  28. if test "$cross_compiling" = yes; then :
  29. - $as_echo "#define RETURN_MACROS_WORK 0" >>confdefs.h
  30. - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
  31. + $as_echo "#define RETURN_MACROS_WORK 1" >>confdefs.h
  32. + { $as_echo "$as_me:${as_lineno-$LINENO}: result: assume yes (cross-compiling)" >&5
  33. $as_echo "no" >&6; }
  34. else
  35. diff --git a/configure.ac b/configure.ac
  36. index a5295f1..9740fdc 100644
  37. --- a/configure.ac
  38. +++ b/configure.ac
  39. @@ -705,7 +705,7 @@ int main()
  40. ])],
  41. [ AC_DEFINE(RETURN_MACROS_WORK, 1) AC_MSG_RESULT([yes]) ],
  42. [ AC_DEFINE(RETURN_MACROS_WORK, 0) AC_MSG_RESULT([no]) ],
  43. -[ AC_DEFINE(RETURN_MACROS_WORK, 0) AC_MSG_RESULT([no]) ]
  44. +[ AC_DEFINE(RETURN_MACROS_WORK, 1) AC_MSG_RESULT([assume yes (cross-compiling)]) ]
  45. )
  46. ##############################################################################
  47. diff --git a/return.h b/return.h
  48. index 9d3f5f1..d916c7a 100644
  49. --- a/return.h
  50. +++ b/return.h
  51. @@ -117,26 +117,16 @@
  52. /*************************************/
  53. /*
  54. - * For DEC Mips machines running Ultrix
  55. + * For Mips machines running Linux
  56. */
  57. #if __mips
  58. -/*
  59. - * I have no idea how to get inline assembly with the default cc.
  60. - * Anyone know how?
  61. - */
  62. -
  63. -#if 0
  64. -
  65. /*
  66. * NOTE: we assume here that file is global.
  67. *
  68. - * $31 is the frame pointer. $2 looks to be the return address but maybe
  69. - * not consistently.
  70. + * $31 is the return address.
  71. */
  72. -#define GET_RET_ADDR(file) asm("sw $2, file")
  73. -
  74. -#endif
  75. +#define GET_RET_ADDR(file) asm("sw $31, %0" : "=m" (file))
  76. #endif /* __mips */
  77. --
  78. 2.25.1