1
0
Fork 0
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:
Vicente Olivert Riera 2014-11-25 01:32:06 -08:00 committed by Dave Watson
parent 2a5d1a6296
commit d9a8b23a35

View file

@ -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. */