Skip to content

Commit

Permalink
Merge pull request #3439 from MalloryA/freebsd-libunwind
Browse files Browse the repository at this point in the history
Use GNU/Linux frame registration code for FreeBSD too
  • Loading branch information
syrusakbary authored Dec 21, 2022
2 parents 168c32d + cb473cb commit b90fb24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Looking for changes that affect our C API? See the [C API Changelog](lib/c-api/C

## **Unreleased**

## Fixed

- [#3439](https://github.com/wasmerio/wasmer/pull/3439) Use GNU/Linux frame registration code for FreeBSD too

## 3.1.0 - 12/12/2022

## Added
Expand Down
5 changes: 4 additions & 1 deletion lib/compiler/src/engine/unwind/systemv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ impl UnwindRegistry {

#[allow(clippy::cast_ptr_alignment)]
unsafe fn register_frames(&mut self, eh_frame: &[u8]) {
if cfg!(all(target_os = "linux", target_env = "gnu")) {
if cfg!(any(
all(target_os = "linux", target_env = "gnu"),
target_os = "freebsd"
)) {
// Registering an empty `eh_frame` (i.e. which
// contains empty FDEs) cause problems on Linux when
// deregistering it. We must avoid this
Expand Down

0 comments on commit b90fb24

Please sign in to comment.