Skip to content

Commit 4992246

Browse files
authored
Update libunwind to LLVM 16.0.6 (#20088)
1 parent a2fa2c8 commit 4992246

38 files changed

+5613
-2082
lines changed

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ See docs/process.md for more on how version tagging works.
2727
- The `--log_html` option was removed from `emrun`. This option was already not
2828
working with python3.8 or above so we hope is safe to say that nobody was
2929
relying on it.
30+
- libunwind updated to LLVM 16.0.6. (#20088)
3031

3132
3.1.44 - 07/25/23
3233
-----------------
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
set(files
2+
__libunwind_config.h
3+
libunwind.h
4+
libunwind.modulemap
5+
mach-o/compact_unwind_encoding.h
6+
mach-o/compact_unwind_encoding.modulemap
7+
unwind_arm_ehabi.h
8+
unwind_itanium.h
9+
unwind.h
10+
)
11+
12+
add_library(unwind-headers INTERFACE)
13+
target_include_directories(unwind-headers INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
14+
15+
if(LIBUNWIND_INSTALL_HEADERS)
16+
foreach(file ${files})
17+
get_filename_component(dir ${file} DIRECTORY)
18+
install(FILES ${file}
19+
DESTINATION "${LIBUNWIND_INSTALL_INCLUDE_DIR}/${dir}"
20+
COMPONENT unwind-headers
21+
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
22+
)
23+
endforeach()
24+
25+
if(NOT CMAKE_CONFIGURATION_TYPES)
26+
add_custom_target(install-unwind-headers
27+
DEPENDS unwind-headers
28+
COMMAND "${CMAKE_COMMAND}"
29+
-DCMAKE_INSTALL_COMPONENT=unwind-headers
30+
-P "${LIBUNWIND_BINARY_DIR}/cmake_install.cmake")
31+
add_custom_target(install-unwind-headers-stripped DEPENDS install-unwind-headers)
32+
endif()
33+
endif()

system/lib/libunwind/include/__libunwind_config.h

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===------------------------- __libunwind_config.h -----------------------===//
1+
//===----------------------------------------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -9,8 +9,10 @@
99
#ifndef ____LIBUNWIND_CONFIG_H__
1010
#define ____LIBUNWIND_CONFIG_H__
1111

12+
#define _LIBUNWIND_VERSION 15000
13+
1214
#if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \
13-
!defined(__ARM_DWARF_EH__)
15+
!defined(__ARM_DWARF_EH__) && !defined(__SEH__)
1416
#define _LIBUNWIND_ARM_EHABI
1517
#endif
1618

@@ -23,10 +25,17 @@
2325
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_OR1K 32
2426
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_MIPS 65
2527
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC 31
28+
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC64 31
2629
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_HEXAGON 34
2730
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV 64
31+
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_VE 143
32+
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_S390X 83
33+
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_LOONGARCH 64
2834

2935
#if defined(_LIBUNWIND_IS_NATIVE_ONLY)
36+
# if defined(__linux__)
37+
# define _LIBUNWIND_TARGET_LINUX 1
38+
# endif
3039
# if defined(__i386__)
3140
# define _LIBUNWIND_TARGET_I386
3241
# define _LIBUNWIND_CONTEXT_SIZE 8
@@ -51,7 +60,7 @@
5160
# define _LIBUNWIND_CONTEXT_SIZE 167
5261
# define _LIBUNWIND_CURSOR_SIZE 179
5362
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
54-
# elif defined(__ppc__)
63+
# elif defined(__powerpc__)
5564
# define _LIBUNWIND_TARGET_PPC 1
5665
# define _LIBUNWIND_CONTEXT_SIZE 117
5766
# define _LIBUNWIND_CURSOR_SIZE 124
@@ -121,20 +130,53 @@
121130
# error "Unsupported MIPS ABI and/or environment"
122131
# endif
123132
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_MIPS
133+
#elif defined(__sparc__) && defined(__arch64__)
134+
#define _LIBUNWIND_TARGET_SPARC64 1
135+
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER \
136+
_LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC64
137+
#define _LIBUNWIND_CONTEXT_SIZE 33
138+
#define _LIBUNWIND_CURSOR_SIZE 45
124139
# elif defined(__sparc__)
125140
#define _LIBUNWIND_TARGET_SPARC 1
126141
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC
127142
#define _LIBUNWIND_CONTEXT_SIZE 16
128143
#define _LIBUNWIND_CURSOR_SIZE 23
129144
# elif defined(__riscv)
130-
# if __riscv_xlen == 64
131-
# define _LIBUNWIND_TARGET_RISCV 1
132-
# define _LIBUNWIND_CONTEXT_SIZE 64
133-
# define _LIBUNWIND_CURSOR_SIZE 76
145+
# define _LIBUNWIND_TARGET_RISCV 1
146+
# if defined(__riscv_flen)
147+
# define RISCV_FLEN __riscv_flen
134148
# else
135-
# error "Unsupported RISC-V ABI"
149+
# define RISCV_FLEN 0
150+
# endif
151+
# define _LIBUNWIND_CONTEXT_SIZE (32 * (__riscv_xlen + RISCV_FLEN) / 64)
152+
# if __riscv_xlen == 32
153+
# define _LIBUNWIND_CURSOR_SIZE (_LIBUNWIND_CONTEXT_SIZE + 7)
154+
# elif __riscv_xlen == 64
155+
# define _LIBUNWIND_CURSOR_SIZE (_LIBUNWIND_CONTEXT_SIZE + 12)
156+
# else
157+
# error "Unsupported RISC-V ABI"
136158
# endif
137159
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV
160+
# elif defined(__ve__)
161+
# define _LIBUNWIND_TARGET_VE 1
162+
# define _LIBUNWIND_CONTEXT_SIZE 67
163+
# define _LIBUNWIND_CURSOR_SIZE 79
164+
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_VE
165+
# elif defined(__s390x__)
166+
# define _LIBUNWIND_TARGET_S390X 1
167+
# define _LIBUNWIND_CONTEXT_SIZE 34
168+
# define _LIBUNWIND_CURSOR_SIZE 46
169+
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_S390X
170+
#elif defined(__loongarch__)
171+
#define _LIBUNWIND_TARGET_LOONGARCH 1
172+
#if __loongarch_grlen == 64
173+
#define _LIBUNWIND_CONTEXT_SIZE 65
174+
#define _LIBUNWIND_CURSOR_SIZE 77
175+
#else
176+
#error "Unsupported LoongArch ABI"
177+
#endif
178+
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER \
179+
_LIBUNWIND_HIGHEST_DWARF_REGISTER_LOONGARCH
138180
# else
139181
# error "Unsupported architecture."
140182
# endif
@@ -149,8 +191,12 @@
149191
# define _LIBUNWIND_TARGET_MIPS_O32 1
150192
# define _LIBUNWIND_TARGET_MIPS_NEWABI 1
151193
# define _LIBUNWIND_TARGET_SPARC 1
194+
# define _LIBUNWIND_TARGET_SPARC64 1
152195
# define _LIBUNWIND_TARGET_HEXAGON 1
153196
# define _LIBUNWIND_TARGET_RISCV 1
197+
# define _LIBUNWIND_TARGET_VE 1
198+
# define _LIBUNWIND_TARGET_S390X 1
199+
#define _LIBUNWIND_TARGET_LOONGARCH 1
154200
# define _LIBUNWIND_CONTEXT_SIZE 167
155201
# define _LIBUNWIND_CURSOR_SIZE 179
156202
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 287

0 commit comments

Comments
 (0)