Skip to content

Commit

Permalink
Update libunwind to LLVM 16.0.6 (emscripten-core#20088)
Browse files Browse the repository at this point in the history
  • Loading branch information
aheejin authored Aug 22, 2023
1 parent a2fa2c8 commit 4992246
Show file tree
Hide file tree
Showing 38 changed files with 5,613 additions and 2,082 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ See docs/process.md for more on how version tagging works.
- The `--log_html` option was removed from `emrun`. This option was already not
working with python3.8 or above so we hope is safe to say that nobody was
relying on it.
- libunwind updated to LLVM 16.0.6. (#20088)

3.1.44 - 07/25/23
-----------------
Expand Down
33 changes: 33 additions & 0 deletions system/lib/libunwind/include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
set(files
__libunwind_config.h
libunwind.h
libunwind.modulemap
mach-o/compact_unwind_encoding.h
mach-o/compact_unwind_encoding.modulemap
unwind_arm_ehabi.h
unwind_itanium.h
unwind.h
)

add_library(unwind-headers INTERFACE)
target_include_directories(unwind-headers INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})

if(LIBUNWIND_INSTALL_HEADERS)
foreach(file ${files})
get_filename_component(dir ${file} DIRECTORY)
install(FILES ${file}
DESTINATION "${LIBUNWIND_INSTALL_INCLUDE_DIR}/${dir}"
COMPONENT unwind-headers
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
endforeach()

if(NOT CMAKE_CONFIGURATION_TYPES)
add_custom_target(install-unwind-headers
DEPENDS unwind-headers
COMMAND "${CMAKE_COMMAND}"
-DCMAKE_INSTALL_COMPONENT=unwind-headers
-P "${LIBUNWIND_BINARY_DIR}/cmake_install.cmake")
add_custom_target(install-unwind-headers-stripped DEPENDS install-unwind-headers)
endif()
endif()
62 changes: 54 additions & 8 deletions system/lib/libunwind/include/__libunwind_config.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===------------------------- __libunwind_config.h -----------------------===//
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
Expand All @@ -9,8 +9,10 @@
#ifndef ____LIBUNWIND_CONFIG_H__
#define ____LIBUNWIND_CONFIG_H__

#define _LIBUNWIND_VERSION 15000

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

Expand All @@ -23,10 +25,17 @@
#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_SPARC64 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_S390X 83
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER_LOONGARCH 64

#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
Expand All @@ -51,7 +60,7 @@
# define _LIBUNWIND_CONTEXT_SIZE 167
# define _LIBUNWIND_CURSOR_SIZE 179
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
# elif defined(__ppc__)
# elif defined(__powerpc__)
# define _LIBUNWIND_TARGET_PPC 1
# define _LIBUNWIND_CONTEXT_SIZE 117
# define _LIBUNWIND_CURSOR_SIZE 124
Expand Down Expand Up @@ -121,20 +130,53 @@
# error "Unsupported MIPS ABI and/or environment"
# endif
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_MIPS
#elif defined(__sparc__) && defined(__arch64__)
#define _LIBUNWIND_TARGET_SPARC64 1
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER \
_LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC64
#define _LIBUNWIND_CONTEXT_SIZE 33
#define _LIBUNWIND_CURSOR_SIZE 45
# 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)
# if __riscv_xlen == 64
# define _LIBUNWIND_TARGET_RISCV 1
# define _LIBUNWIND_CONTEXT_SIZE 64
# define _LIBUNWIND_CURSOR_SIZE 76
# define _LIBUNWIND_TARGET_RISCV 1
# if defined(__riscv_flen)
# define RISCV_FLEN __riscv_flen
# else
# error "Unsupported RISC-V ABI"
# 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
# elif defined(__s390x__)
# define _LIBUNWIND_TARGET_S390X 1
# define _LIBUNWIND_CONTEXT_SIZE 34
# define _LIBUNWIND_CURSOR_SIZE 46
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_S390X
#elif defined(__loongarch__)
#define _LIBUNWIND_TARGET_LOONGARCH 1
#if __loongarch_grlen == 64
#define _LIBUNWIND_CONTEXT_SIZE 65
#define _LIBUNWIND_CURSOR_SIZE 77
#else
#error "Unsupported LoongArch ABI"
#endif
#define _LIBUNWIND_HIGHEST_DWARF_REGISTER \
_LIBUNWIND_HIGHEST_DWARF_REGISTER_LOONGARCH
# else
# error "Unsupported architecture."
# endif
Expand All @@ -149,8 +191,12 @@
# define _LIBUNWIND_TARGET_MIPS_O32 1
# define _LIBUNWIND_TARGET_MIPS_NEWABI 1
# define _LIBUNWIND_TARGET_SPARC 1
# define _LIBUNWIND_TARGET_SPARC64 1
# define _LIBUNWIND_TARGET_HEXAGON 1
# define _LIBUNWIND_TARGET_RISCV 1
# define _LIBUNWIND_TARGET_VE 1
# define _LIBUNWIND_TARGET_S390X 1
#define _LIBUNWIND_TARGET_LOONGARCH 1
# define _LIBUNWIND_CONTEXT_SIZE 167
# define _LIBUNWIND_CURSOR_SIZE 179
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 287
Expand Down
Loading

0 comments on commit 4992246

Please sign in to comment.