branch Attitude Adjustment packages
[12.09/packages.git] / devel / dmalloc / patches / 200-fix_return_address.patch
1 --- a/configure
2 +++ b/configure
3 @@ -7120,7 +7120,7 @@ echo "$as_me:$LINENO: checking return.h
4  echo $ECHO_N "checking return.h macros work... $ECHO_C" >&6
5  if test "$cross_compiling" = yes; then
6     cat >>confdefs.h <<\_ACEOF
7 -#define RETURN_MACROS_WORK 0
8 +#define RETURN_MACROS_WORK 1
9  _ACEOF
10   echo "$as_me:$LINENO: result: no" >&5
11  echo "${ECHO_T}no" >&6
12 --- a/return.h
13 +++ b/return.h
14 @@ -106,25 +106,19 @@
15  /*************************************/
16  
17  /*
18 - * For DEC Mips machines running Ultrix
19 + * For Mips machines running Linux
20   */
21  #if __mips
22  
23  /*
24 - * I have no idea how to get inline assembly with the default cc.
25 - * Anyone know how?
26 - */
27 -
28 -#if 0
29 -
30 -/*
31   * NOTE: we assume here that file is global.
32   *
33 - * $31 is the frame pointer.  $2 looks to be the return address but maybe
34 - * not consistently.
35 + * $31 is the return address.
36   */
37 -#define GET_RET_ADDR(file)     asm("sw $2, file")
38 -
39 +#if (_MIPS_SZLONG == 32)
40 +#define GET_RET_ADDR(file)     asm("sw $31, %0" : "=m" (file))
41 +#else
42 +#define GET_RET_ADDR(file)     asm("sd $31, %0" : "=m" (file))
43  #endif
44  
45  #endif /* __mips */