Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for llvm libunwind #3683

Merged
merged 18 commits into from
Jan 4, 2022
Merged
Prev Previous commit
Next Next commit
format headers
Signed-off-by: SchrodingerZhu <i@zhuyi.fan>
  • Loading branch information
SchrodingerZhu committed Dec 31, 2021
commit c2a4ed27a914909b2b91bb57fd9b1be922491049
309 changes: 154 additions & 155 deletions contrib/libunwind-llvm/__libunwind_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,168 +9,167 @@
#ifndef ____LIBUNWIND_CONFIG_H__
#define ____LIBUNWIND_CONFIG_H__

#if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \
!defined(__ARM_DWARF_EH__)
#if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__ARM_DWARF_EH__)
#define _LIBUNWIND_ARM_EHABI
#endif

#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86 8
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86_64 32
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC 112
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64 116
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM64 95
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM 287
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_OR1K 32
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_MIPS 65
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC 31
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_HEXAGON 34
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV 64
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_VE 143
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86 8
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86_64 32
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC 112
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64 116
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM64 95
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM 287
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_OR1K 32
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_MIPS 65
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC 31
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_HEXAGON 34
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV 64
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_VE 143

#if defined(_LIBUNWIND_IS_NATIVE_ONLY)
# if defined(__linux__)
# define _LIBUNWIND_TARGET_LINUX 1
# endif
# if defined(__i386__)
# define _LIBUNWIND_TARGET_I386
# define _LIBUNWIND_CONTEXT_SIZE 8
# define _LIBUNWIND_CURSOR_SIZE 15
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86
# elif defined(__x86_64__)
# define _LIBUNWIND_TARGET_X86_64 1
# if defined(_WIN64)
# define _LIBUNWIND_CONTEXT_SIZE 54
# ifdef __SEH__
# define _LIBUNWIND_CURSOR_SIZE 204
# else
# define _LIBUNWIND_CURSOR_SIZE 66
# endif
# else
# define _LIBUNWIND_CONTEXT_SIZE 21
# define _LIBUNWIND_CURSOR_SIZE 33
# endif
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86_64
# elif defined(__powerpc64__)
# define _LIBUNWIND_TARGET_PPC64 1
# define _LIBUNWIND_CONTEXT_SIZE 167
# define _LIBUNWIND_CURSOR_SIZE 179
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
# elif defined(__ppc__)
# define _LIBUNWIND_TARGET_PPC 1
# define _LIBUNWIND_CONTEXT_SIZE 117
# define _LIBUNWIND_CURSOR_SIZE 124
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC
# elif defined(__aarch64__)
# define _LIBUNWIND_TARGET_AARCH64 1
# define _LIBUNWIND_CONTEXT_SIZE 66
# if defined(__SEH__)
# define _LIBUNWIND_CURSOR_SIZE 164
# else
# define _LIBUNWIND_CURSOR_SIZE 78
# endif
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM64
# elif defined(__arm__)
# define _LIBUNWIND_TARGET_ARM 1
# if defined(__SEH__)
# define _LIBUNWIND_CONTEXT_SIZE 42
# define _LIBUNWIND_CURSOR_SIZE 80
# elif defined(__ARM_WMMX)
# define _LIBUNWIND_CONTEXT_SIZE 61
# define _LIBUNWIND_CURSOR_SIZE 68
# else
# define _LIBUNWIND_CONTEXT_SIZE 42
# define _LIBUNWIND_CURSOR_SIZE 49
# endif
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM
# elif defined(__or1k__)
# define _LIBUNWIND_TARGET_OR1K 1
# define _LIBUNWIND_CONTEXT_SIZE 16
# define _LIBUNWIND_CURSOR_SIZE 24
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_OR1K
# elif defined(__hexagon__)
# define _LIBUNWIND_TARGET_HEXAGON 1
#if defined(__linux__)
#define _LIBUNWIND_TARGET_LINUX 1
#endif
#if defined(__i386__)
#define _LIBUNWIND_TARGET_I386
#define _LIBUNWIND_CONTEXT_SIZE 8
#define _LIBUNWIND_CURSOR_SIZE 15
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86
#elif defined(__x86_64__)
#define _LIBUNWIND_TARGET_X86_64 1
#if defined(_WIN64)
#define _LIBUNWIND_CONTEXT_SIZE 54
#ifdef __SEH__
#define _LIBUNWIND_CURSOR_SIZE 204
#else
#define _LIBUNWIND_CURSOR_SIZE 66
#endif
#else
#define _LIBUNWIND_CONTEXT_SIZE 21
#define _LIBUNWIND_CURSOR_SIZE 33
#endif
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_X86_64
#elif defined(__powerpc64__)
#define _LIBUNWIND_TARGET_PPC64 1
#define _LIBUNWIND_CONTEXT_SIZE 167
#define _LIBUNWIND_CURSOR_SIZE 179
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
#elif defined(__ppc__)
#define _LIBUNWIND_TARGET_PPC 1
#define _LIBUNWIND_CONTEXT_SIZE 117
#define _LIBUNWIND_CURSOR_SIZE 124
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC
#elif defined(__aarch64__)
#define _LIBUNWIND_TARGET_AARCH64 1
#define _LIBUNWIND_CONTEXT_SIZE 66
#if defined(__SEH__)
#define _LIBUNWIND_CURSOR_SIZE 164
#else
#define _LIBUNWIND_CURSOR_SIZE 78
#endif
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM64
#elif defined(__arm__)
#define _LIBUNWIND_TARGET_ARM 1
#if defined(__SEH__)
#define _LIBUNWIND_CONTEXT_SIZE 42
#define _LIBUNWIND_CURSOR_SIZE 80
#elif defined(__ARM_WMMX)
#define _LIBUNWIND_CONTEXT_SIZE 61
#define _LIBUNWIND_CURSOR_SIZE 68
#else
#define _LIBUNWIND_CONTEXT_SIZE 42
#define _LIBUNWIND_CURSOR_SIZE 49
#endif
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_ARM
#elif defined(__or1k__)
#define _LIBUNWIND_TARGET_OR1K 1
#define _LIBUNWIND_CONTEXT_SIZE 16
#define _LIBUNWIND_CURSOR_SIZE 24
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_OR1K
#elif defined(__hexagon__)
#define _LIBUNWIND_TARGET_HEXAGON 1
// Values here change when : Registers.hpp - hexagon_thread_state_t change
# define _LIBUNWIND_CONTEXT_SIZE 18
# define _LIBUNWIND_CURSOR_SIZE 24
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_HEXAGON
# elif defined(__mips__)
# if defined(_ABIO32) && _MIPS_SIM == _ABIO32
# define _LIBUNWIND_TARGET_MIPS_O32 1
# if defined(__mips_hard_float)
# define _LIBUNWIND_CONTEXT_SIZE 50
# define _LIBUNWIND_CURSOR_SIZE 57
# else
# define _LIBUNWIND_CONTEXT_SIZE 18
# define _LIBUNWIND_CURSOR_SIZE 24
# endif
# elif defined(_ABIN32) && _MIPS_SIM == _ABIN32
# define _LIBUNWIND_TARGET_MIPS_NEWABI 1
# if defined(__mips_hard_float)
# define _LIBUNWIND_CONTEXT_SIZE 67
# define _LIBUNWIND_CURSOR_SIZE 74
# else
# define _LIBUNWIND_CONTEXT_SIZE 35
# define _LIBUNWIND_CURSOR_SIZE 42
# endif
# elif defined(_ABI64) && _MIPS_SIM == _ABI64
# define _LIBUNWIND_TARGET_MIPS_NEWABI 1
# if defined(__mips_hard_float)
# define _LIBUNWIND_CONTEXT_SIZE 67
# define _LIBUNWIND_CURSOR_SIZE 79
# else
# define _LIBUNWIND_CONTEXT_SIZE 35
# define _LIBUNWIND_CURSOR_SIZE 47
# endif
# else
# error "Unsupported MIPS ABI and/or environment"
# endif
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_MIPS
# elif defined(__sparc__)
#define _LIBUNWIND_TARGET_SPARC 1
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC
#define _LIBUNWIND_CONTEXT_SIZE 16
#define _LIBUNWIND_CURSOR_SIZE 23
# elif defined(__riscv)
# define _LIBUNWIND_TARGET_RISCV 1
# if defined(__riscv_flen)
# define RISCV_FLEN __riscv_flen
# else
# define RISCV_FLEN 0
# endif
# define _LIBUNWIND_CONTEXT_SIZE (32 * (__riscv_xlen + RISCV_FLEN) / 64)
# if __riscv_xlen == 32
# define _LIBUNWIND_CURSOR_SIZE (_LIBUNWIND_CONTEXT_SIZE + 7)
# elif __riscv_xlen == 64
# define _LIBUNWIND_CURSOR_SIZE (_LIBUNWIND_CONTEXT_SIZE + 12)
# else
# error "Unsupported RISC-V ABI"
# endif
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV
# elif defined(__ve__)
# define _LIBUNWIND_TARGET_VE 1
# define _LIBUNWIND_CONTEXT_SIZE 67
# define _LIBUNWIND_CURSOR_SIZE 79
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_VE
# else
# error "Unsupported architecture."
# endif
#define _LIBUNWIND_CONTEXT_SIZE 18
#define _LIBUNWIND_CURSOR_SIZE 24
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_HEXAGON
#elif defined(__mips__)
#if defined(_ABIO32) && _MIPS_SIM == _ABIO32
#define _LIBUNWIND_TARGET_MIPS_O32 1
#if defined(__mips_hard_float)
#define _LIBUNWIND_CONTEXT_SIZE 50
#define _LIBUNWIND_CURSOR_SIZE 57
#else
#define _LIBUNWIND_CONTEXT_SIZE 18
#define _LIBUNWIND_CURSOR_SIZE 24
#endif
#elif defined(_ABIN32) && _MIPS_SIM == _ABIN32
#define _LIBUNWIND_TARGET_MIPS_NEWABI 1
#if defined(__mips_hard_float)
#define _LIBUNWIND_CONTEXT_SIZE 67
#define _LIBUNWIND_CURSOR_SIZE 74
#else
#define _LIBUNWIND_CONTEXT_SIZE 35
#define _LIBUNWIND_CURSOR_SIZE 42
#endif
#elif defined(_ABI64) && _MIPS_SIM == _ABI64
#define _LIBUNWIND_TARGET_MIPS_NEWABI 1
#if defined(__mips_hard_float)
#define _LIBUNWIND_CONTEXT_SIZE 67
#define _LIBUNWIND_CURSOR_SIZE 79
#else
#define _LIBUNWIND_CONTEXT_SIZE 35
#define _LIBUNWIND_CURSOR_SIZE 47
#endif
#else
#error "Unsupported MIPS ABI and/or environment"
#endif
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_MIPS
#elif defined(__sparc__)
#define _LIBUNWIND_TARGET_SPARC 1
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC
#define _LIBUNWIND_CONTEXT_SIZE 16
#define _LIBUNWIND_CURSOR_SIZE 23
#elif defined(__riscv)
#define _LIBUNWIND_TARGET_RISCV 1
#if defined(__riscv_flen)
#define RISCV_FLEN __riscv_flen
#else
#define RISCV_FLEN 0
#endif
#define _LIBUNWIND_CONTEXT_SIZE (32 * (__riscv_xlen + RISCV_FLEN) / 64)
#if __riscv_xlen == 32
#define _LIBUNWIND_CURSOR_SIZE (_LIBUNWIND_CONTEXT_SIZE + 7)
#elif __riscv_xlen == 64
#define _LIBUNWIND_CURSOR_SIZE (_LIBUNWIND_CONTEXT_SIZE + 12)
#else
#error "Unsupported RISC-V ABI"
#endif
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV
#elif defined(__ve__)
#define _LIBUNWIND_TARGET_VE 1
#define _LIBUNWIND_CONTEXT_SIZE 67
#define _LIBUNWIND_CURSOR_SIZE 79
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_VE
#else
#error "Unsupported architecture."
#endif
#else // !_LIBUNWIND_IS_NATIVE_ONLY
# define _LIBUNWIND_TARGET_I386
# define _LIBUNWIND_TARGET_X86_64 1
# define _LIBUNWIND_TARGET_PPC 1
# define _LIBUNWIND_TARGET_PPC64 1
# define _LIBUNWIND_TARGET_AARCH64 1
# define _LIBUNWIND_TARGET_ARM 1
# define _LIBUNWIND_TARGET_OR1K 1
# define _LIBUNWIND_TARGET_MIPS_O32 1
# define _LIBUNWIND_TARGET_MIPS_NEWABI 1
# define _LIBUNWIND_TARGET_SPARC 1
# define _LIBUNWIND_TARGET_HEXAGON 1
# define _LIBUNWIND_TARGET_RISCV 1
# define _LIBUNWIND_TARGET_VE 1
# define _LIBUNWIND_CONTEXT_SIZE 167
# define _LIBUNWIND_CURSOR_SIZE 179
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 287
#define _LIBUNWIND_TARGET_I386
#define _LIBUNWIND_TARGET_X86_64 1
#define _LIBUNWIND_TARGET_PPC 1
#define _LIBUNWIND_TARGET_PPC64 1
#define _LIBUNWIND_TARGET_AARCH64 1
#define _LIBUNWIND_TARGET_ARM 1
#define _LIBUNWIND_TARGET_OR1K 1
#define _LIBUNWIND_TARGET_MIPS_O32 1
#define _LIBUNWIND_TARGET_MIPS_NEWABI 1
#define _LIBUNWIND_TARGET_SPARC 1
#define _LIBUNWIND_TARGET_HEXAGON 1
#define _LIBUNWIND_TARGET_RISCV 1
#define _LIBUNWIND_TARGET_VE 1
#define _LIBUNWIND_CONTEXT_SIZE 167
#define _LIBUNWIND_CURSOR_SIZE 179
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER 287
#endif // _LIBUNWIND_IS_NATIVE_ONLY

#endif // ____LIBUNWIND_CONFIG_H__
Loading