617-mips_fix_setjmp_ptrsize.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. --- a/libc/sysdeps/linux/mips/bits/setjmp.h
  2. +++ b/libc/sysdeps/linux/mips/bits/setjmp.h
  3. @@ -27,18 +27,18 @@
  4. #include <sgidefs.h>
  5. #if _MIPS_SIM == _MIPS_SIM_ABI32
  6. -#define ptrsize void *
  7. +#define __setjmp_ptr void *
  8. #else
  9. -#define ptrsize long long
  10. +#define __setjmp_ptr long long
  11. #endif
  12. typedef struct
  13. {
  14. /* Program counter. */
  15. - ptrsize __pc;
  16. + __setjmp_ptr __pc;
  17. /* Stack pointer. */
  18. - ptrsize __sp;
  19. + __setjmp_ptr __sp;
  20. /* Callee-saved registers s0 through s7. */
  21. #if _MIPS_SIM == _MIPS_SIM_ABI32
  22. @@ -48,10 +48,10 @@ typedef struct
  23. #endif
  24. /* The frame pointer. */
  25. - ptrsize __fp;
  26. + __setjmp_ptr __fp;
  27. /* The global pointer. */
  28. - ptrsize __gp;
  29. + __setjmp_ptr __gp;
  30. /* Floating point status register. */
  31. int __fpc_csr;
  32. --- a/libc/sysdeps/linux/mips/setjmp_aux.c
  33. +++ b/libc/sysdeps/linux/mips/setjmp_aux.c
  34. @@ -65,14 +65,14 @@ __sigsetjmp_aux (jmp_buf env, int savema
  35. #endif
  36. /* .. and the stack pointer; */
  37. - env[0].__jmpbuf[0].__sp = (ptrsize) sp;
  38. + env[0].__jmpbuf[0].__sp = (__setjmp_ptr) sp;
  39. /* .. and the FP; it'll be in s8. */
  40. - env[0].__jmpbuf[0].__fp = (ptrsize) fp;
  41. + env[0].__jmpbuf[0].__fp = (__setjmp_ptr) fp;
  42. /* .. and the GP; */
  43. #if _MIPS_SIM == _MIPS_SIM_ABI64
  44. - env[0].__jmpbuf[0].__gp = (ptrsize) gp;
  45. + env[0].__jmpbuf[0].__gp = (__setjmp_ptr) gp;
  46. #else
  47. __asm__ __volatile__ ("sw $gp, %0" : : "m" (env[0].__jmpbuf[0].__gp));
  48. #endif