<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/libunwind/src/libunwind.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>libunwind: Implement the unw_strerror function for better nongnu libunwind compatibility (#160887)</title>
<updated>2025-11-12T04:45:42+00:00</updated>
<author>
<name>Gleb Popov</name>
<email>6yearold@gmail.com</email>
</author>
<published>2025-11-12T04:45:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=54659793328a0a7f0f1efa9d4d7fc43999b34ae2'/>
<id>54659793328a0a7f0f1efa9d4d7fc43999b34ae2</id>
<content type='text'>
As it was explained to me in
https://discourse.llvm.org/t/libunwinds-raison-detre/88283/2 the LLVM
version of libunwind is mostly compatible with nongnu one. This change
improves the compatibility a bit further.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As it was explained to me in
https://discourse.llvm.org/t/libunwinds-raison-detre/88283/2 the LLVM
version of libunwind is mostly compatible with nongnu one. This change
improves the compatibility a bit further.</pre>
</div>
</content>
</entry>
<entry>
<title>[libunwind] Fix execution flow imbalance when using C++ Exceptions (#165066)</title>
<updated>2025-11-12T02:31:57+00:00</updated>
<author>
<name>Med Ismail Bennani</name>
<email>ismail@bennani.ma</email>
</author>
<published>2025-11-12T02:31:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cf35502dd569d842a860696650a783f896db0648'/>
<id>cf35502dd569d842a860696650a783f896db0648</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[runtimes][PAC] Harden unwinding when possible (#143230)</title>
<updated>2025-10-20T16:57:45+00:00</updated>
<author>
<name>Oliver Hunt</name>
<email>oliver@apple.com</email>
</author>
<published>2025-10-20T16:57:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e6a1aff5916447630e9ec0e8a90594ca1ee7a1be'/>
<id>e6a1aff5916447630e9ec0e8a90594ca1ee7a1be</id>
<content type='text'>
This hardens the unwinding logic and datastructures on systems
that support pointer authentication.

The approach taken to hardening is to harden the schemas of as many
high value fields in the myriad structs as possible, and then also
explicitly qualify local variables referencing privileged or security
critical values.

This does introduce ABI linkage between libcxx, libcxxabi, and
libunwind but those are in principle separate from the OS itself
so we've kept the schema definitions in the library specific headers
rather than ptrauth.h</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This hardens the unwinding logic and datastructures on systems
that support pointer authentication.

The approach taken to hardening is to harden the schemas of as many
high value fields in the myriad structs as possible, and then also
explicitly qualify local variables referencing privileged or security
critical values.

This does introduce ABI linkage between libcxx, libcxxabi, and
libunwind but those are in principle separate from the OS itself
so we've kept the schema definitions in the library specific headers
rather than ptrauth.h</pre>
</div>
</content>
</entry>
<entry>
<title>[WebAssembly] __USING_WASM_EXCEPTIONS__ -&gt; __WASM_EXCEPTIONS__ (#92840)</title>
<updated>2024-05-22T04:01:36+00:00</updated>
<author>
<name>Heejin Ahn</name>
<email>aheejin@gmail.com</email>
</author>
<published>2024-05-22T04:01:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=64f640680f7b1ddc8d2015eac75865f231166f8c'/>
<id>64f640680f7b1ddc8d2015eac75865f231166f8c</id>
<content type='text'>
We've decided to change `__USING_WASM_EXCEPTIONS__` preprocessor to
`__WASM_EXCEPTIONS__` given that it's more concise.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We've decided to change `__USING_WASM_EXCEPTIONS__` preprocessor to
`__WASM_EXCEPTIONS__` given that it's more concise.</pre>
</div>
</content>
</entry>
<entry>
<title>[libunwind][WebAssembly] Make libunwind compilable (#92192)</title>
<updated>2024-05-21T22:43:08+00:00</updated>
<author>
<name>Heejin Ahn</name>
<email>aheejin@gmail.com</email>
</author>
<published>2024-05-21T22:43:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f6ff87dd90074b694e420d93389c749189bca0ec'/>
<id>f6ff87dd90074b694e420d93389c749189bca0ec</id>
<content type='text'>
This tries to make Wasm compilable in LLVM tree with CMake for
non-Emscripten platform.

This
- Adds `-D__USING_WASM_EXCEPTIONS__` when you compile with
`-fwasm-exceptions` (like other EH options) in Clang
- Exclude `UnwindLevel1.c`, `UnwindRegistersSave.S`, and
`UnwindRegistersRestore.S` when compiling with Wasm
- Changed some `__USING_WASM_EXCEPTIONS__` to `__wasm__`; they should be
applied when compiling with Wasm w/o exceptions.
- Define some unused macros to make it compile

Fixes #72771.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This tries to make Wasm compilable in LLVM tree with CMake for
non-Emscripten platform.

This
- Adds `-D__USING_WASM_EXCEPTIONS__` when you compile with
`-fwasm-exceptions` (like other EH options) in Clang
- Exclude `UnwindLevel1.c`, `UnwindRegistersSave.S`, and
`UnwindRegistersRestore.S` when compiling with Wasm
- Changed some `__USING_WASM_EXCEPTIONS__` to `__wasm__`; they should be
applied when compiling with Wasm w/o exceptions.
- Define some unused macros to make it compile

Fixes #72771.</pre>
</div>
</content>
</entry>
<entry>
<title>[libunwind][WebAssembly] Fix libunwind.cpp guard (#78230)</title>
<updated>2024-01-16T13:48:50+00:00</updated>
<author>
<name>Heejin Ahn</name>
<email>aheejin@gmail.com</email>
</author>
<published>2024-01-16T13:48:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4967d98eda48bed4a6f382d240f5a33177bc654c'/>
<id>4967d98eda48bed4a6f382d240f5a33177bc654c</id>
<content type='text'>
This should have been `&amp;&amp;`, meaning neither SjLj nor Wasm uses this
file.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This should have been `&amp;&amp;`, meaning neither SjLj nor Wasm uses this
file.</pre>
</div>
</content>
</entry>
<entry>
<title>[libunwind]  fix dynamic .eh_frame registration (#77185)</title>
<updated>2024-01-16T02:13:11+00:00</updated>
<author>
<name>SihangZhu</name>
<email>zhusihang@huawei.com</email>
</author>
<published>2024-01-16T02:13:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=58b33d0301a36900fc641b4b0e110b683064bab8'/>
<id>58b33d0301a36900fc641b4b0e110b683064bab8</id>
<content type='text'>
Fix this issue
[#76957](https://github.com/llvm/llvm-project/issues/76957)
Libgcc provides __register_frame to register a dynamic .eh_frame
section, while __unw_add_dynamic_eh_frame_section can be used to do the
same in libunwind. However, the address after dynamic .eh_frame are
padding with 0 value, it will be identified as
legal CIE. And __unw_add_dynamic_eh_frame_section will continue to parse
subsequent addresses until illegal memory or other sections are
accessed.
This patch adds length formal parameter for dynamic registration.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix this issue
[#76957](https://github.com/llvm/llvm-project/issues/76957)
Libgcc provides __register_frame to register a dynamic .eh_frame
section, while __unw_add_dynamic_eh_frame_section can be used to do the
same in libunwind. However, the address after dynamic .eh_frame are
padding with 0 value, it will be identified as
legal CIE. And __unw_add_dynamic_eh_frame_section will continue to parse
subsequent addresses until illegal memory or other sections are
accessed.
This patch adds length formal parameter for dynamic registration.</pre>
</div>
</content>
</entry>
<entry>
<title>[libunwind][WebAssembly] Omit unused parts of libunwind.cpp for Wasm (#73196)</title>
<updated>2023-11-30T02:03:58+00:00</updated>
<author>
<name>Heejin Ahn</name>
<email>aheejin@gmail.com</email>
</author>
<published>2023-11-30T02:03:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e88a2f123fa4843ae3782377668cf5741acc9121'/>
<id>e88a2f123fa4843ae3782377668cf5741acc9121</id>
<content type='text'>
Wasm doesn't use most of that file; Wasm does not allow access of system
registers and those functionalities are provided from the VM.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Wasm doesn't use most of that file; Wasm does not allow access of system
registers and those functionalities are provided from the VM.</pre>
</div>
</content>
</entry>
<entry>
<title>[libunwind] On Darwin, add a callback-based lookup scheme for JIT'd unwind info.</title>
<updated>2023-02-10T22:36:25+00:00</updated>
<author>
<name>Lang Hames</name>
<email>lhames@gmail.com</email>
</author>
<published>2023-01-20T04:45:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0751fc68b976d25dd3041217dad16622cf151cd6'/>
<id>0751fc68b976d25dd3041217dad16622cf151cd6</id>
<content type='text'>
This commit adds support for a new callback-based lookup scheme for unwind
info that was inspired by the `_dyld_find_unwind_info_sections` SPI that
libunwind uses to find unwind-info in non-JIT'd frames. From
llvm-project/libunwind/src/AddressSpace.hpp:

```
struct dyld_unwind_sections {
  const struct mach_header*   mh;
  const void*                 dwarf_section;
  uintptr_t                   dwarf_section_length;
  const void*                 compact_unwind_section;
  uintptr_t                   compact_unwind_section_length;
};

extern bool _dyld_find_unwind_sections(void *, dyld_unwind_sections *);
```

During unwinding libunwind calls `_dyld_find_unwind_sections` to both find
unwind section addresses and identify the subarchitecture for frames (via the
MachO-header pointed to by the mh field).

This commit introduces two new libunwind SPI functions:

```
struct unw_dynamic_unwind_sections {
  unw_word_t dso_base;
  unw_word_t dwarf_section;
  size_t     dwarf_section_length;
  unw_word_t compact_unwind_section;
  size_t     compact_unwind_section_length;
};

typedef int (*unw_find_dynamic_unwind_sections)(
    unw_word_t addr, struct unw_dynamic_unwind_sections *info);

// Returns UNW_ESUCCESS if successfully registered, UNW_EINVAL for duplicate
// registrations, and UNW_ENOMEM to indicate too many registrations.
extern int __unw_add_find_dynamic_unwind_sections(
    unw_find_dynamic_unwind_sections find_dynamic_unwind_sections);

// Returns UNW_ESUCCESS if successfully deregistered, UNW_EINVAL to indicate
// no such registration.
extern int __unw_remove_find_dynamic_unwind_sections(
    unw_find_dynamic_unwind_sections find_dynamic_unwind_sections);
```

These can be used to register and deregister callbacks that have a similar
signature to `_dyld_find_unwind_sections`. During unwinding if
`_dyld_find_unwind_sections` returns false (indicating that no frame info
was found by dyld) then registered callbacks are run in registration order until
either the unwind info is found or the end of the list is reached.

With this commit, and by implementing the find-unwind-info callback in the ORC
runtime in LLVM, we (1) enable support for registering JIT'd compact-unwind info
with libunwind*, (2) provide a way to identify the subarchitecture for each frame
(by returning a pointer to a JIT'd MachO header), and (3) delegate tracking of
unwind info to the callback, which may be able to implement more efficient
address-based lookup than libunwind.

* JITLink does not process or register compact unwind info yet, so this patch
  does not fully enable compact unwind info in ORC, it simply provides some
  necessary plumbing. JITLink support for compact unwind should land some time
  in the LLVM 17 development cycle.

Reviewed By: pete

Differential Revision: https://reviews.llvm.org/D142176
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit adds support for a new callback-based lookup scheme for unwind
info that was inspired by the `_dyld_find_unwind_info_sections` SPI that
libunwind uses to find unwind-info in non-JIT'd frames. From
llvm-project/libunwind/src/AddressSpace.hpp:

```
struct dyld_unwind_sections {
  const struct mach_header*   mh;
  const void*                 dwarf_section;
  uintptr_t                   dwarf_section_length;
  const void*                 compact_unwind_section;
  uintptr_t                   compact_unwind_section_length;
};

extern bool _dyld_find_unwind_sections(void *, dyld_unwind_sections *);
```

During unwinding libunwind calls `_dyld_find_unwind_sections` to both find
unwind section addresses and identify the subarchitecture for frames (via the
MachO-header pointed to by the mh field).

This commit introduces two new libunwind SPI functions:

```
struct unw_dynamic_unwind_sections {
  unw_word_t dso_base;
  unw_word_t dwarf_section;
  size_t     dwarf_section_length;
  unw_word_t compact_unwind_section;
  size_t     compact_unwind_section_length;
};

typedef int (*unw_find_dynamic_unwind_sections)(
    unw_word_t addr, struct unw_dynamic_unwind_sections *info);

// Returns UNW_ESUCCESS if successfully registered, UNW_EINVAL for duplicate
// registrations, and UNW_ENOMEM to indicate too many registrations.
extern int __unw_add_find_dynamic_unwind_sections(
    unw_find_dynamic_unwind_sections find_dynamic_unwind_sections);

// Returns UNW_ESUCCESS if successfully deregistered, UNW_EINVAL to indicate
// no such registration.
extern int __unw_remove_find_dynamic_unwind_sections(
    unw_find_dynamic_unwind_sections find_dynamic_unwind_sections);
```

These can be used to register and deregister callbacks that have a similar
signature to `_dyld_find_unwind_sections`. During unwinding if
`_dyld_find_unwind_sections` returns false (indicating that no frame info
was found by dyld) then registered callbacks are run in registration order until
either the unwind info is found or the end of the list is reached.

With this commit, and by implementing the find-unwind-info callback in the ORC
runtime in LLVM, we (1) enable support for registering JIT'd compact-unwind info
with libunwind*, (2) provide a way to identify the subarchitecture for each frame
(by returning a pointer to a JIT'd MachO header), and (3) delegate tracking of
unwind info to the callback, which may be able to implement more efficient
address-based lookup than libunwind.

* JITLink does not process or register compact unwind info yet, so this patch
  does not fully enable compact unwind info in ORC, it simply provides some
  necessary plumbing. JITLink support for compact unwind should land some time
  in the LLVM 17 development cycle.

Reviewed By: pete

Differential Revision: https://reviews.llvm.org/D142176
</pre>
</div>
</content>
</entry>
<entry>
<title>[libunwind][LoongArch] Add 64-bit LoongArch support</title>
<updated>2022-11-15T06:37:00+00:00</updated>
<author>
<name>zhanglimin</name>
<email>zhanglimin@loongson.cn</email>
</author>
<published>2022-11-15T06:36:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c5072695127e767a76973cdbed683215df31fa40'/>
<id>c5072695127e767a76973cdbed683215df31fa40</id>
<content type='text'>
Defines enums for the LoongArch registers.
Adds the register class implementation for LoongArch.
Adds save and restore context functionality.

This only supports 64 bits integer and float-point register
implementation.

Fix https://github.com/llvm/llvm-project/issues/55398

Reviewed By: SixWeining

Differential Revision: https://reviews.llvm.org/D137010
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Defines enums for the LoongArch registers.
Adds the register class implementation for LoongArch.
Adds save and restore context functionality.

This only supports 64 bits integer and float-point register
implementation.

Fix https://github.com/llvm/llvm-project/issues/55398

Reviewed By: SixWeining

Differential Revision: https://reviews.llvm.org/D137010
</pre>
</div>
</content>
</entry>
</feed>
