mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-12-23 03:53:43 +01:00
mips: support MIPS64 n32 mode
The attached patch fixes a problem with Xorg on MIPS64 n32 which is explained here: https://bugs.freedesktop.org/show_bug.cgi?id=79939 Basically, libunwind is using a word size of 64-bit for all MIPS variants. Then, Xorg does a casting to (void *) of a 64-bit variable provided by libunwind. Given that the size of the pointers in MIPS64 n32 is 32-bit wide, that casting causes an error like this one: backtrace.c:90:20: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
This commit is contained in:
parent
2a5d1a6296
commit
d9a8b23a35
1 changed files with 7 additions and 4 deletions
|
@ -50,11 +50,14 @@ extern "C" {
|
|||
/* FIXME for MIPS. Too big? What do other things use for similar tasks? */
|
||||
#define UNW_TDEP_CURSOR_LEN 4096
|
||||
|
||||
/* The size of a "word" varies on MIPS. This type is used for memory
|
||||
addresses and register values. To allow a single library to support
|
||||
multiple ABIs, and to support N32 at all, we must use a 64-bit type
|
||||
even when addresses are only 32 bits. */
|
||||
/* The size of a "word" varies on MIPS. This type is used for memory
|
||||
addresses and register values, which are 32-bit wide for O32 and N32
|
||||
ABIs, and 64-bit wide for N64 ABI. */
|
||||
#if _MIPS_SIM == _ABI64
|
||||
typedef uint64_t unw_word_t;
|
||||
#else
|
||||
typedef uint32_t unw_word_t;
|
||||
#endif
|
||||
typedef int32_t unw_sword_t;
|
||||
|
||||
/* FIXME: MIPS ABIs. */
|
||||
|
|
Loading…
Reference in a new issue