Skip to content

Commit

Permalink
feat(compiler): Initial support for GOT-based relocations and `compac…
Browse files Browse the repository at this point in the history
…t_unwind` tables for Mach-O

(Work in progress) macOS uses a different scheme for exception handling
in Mach-O; in contrast with the "usual" .eh_frame mechanism, Mach-O has
a `compact_unwind` section in which EH-related metadata are embedded.
This commit begins the effort to support it in its entirety. On the path
to that end, it also adds GOT-based relocations, which are necessary for
Mach-O object files.
  • Loading branch information
xdoardo committed Jan 15, 2025
1 parent dc22742 commit 77e21da
Show file tree
Hide file tree
Showing 19 changed files with 1,058 additions and 250 deletions.
69 changes: 66 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/compiler-cranelift/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ impl Compiler for CraneliftCompiler {
function_call_trampolines,
dynamic_function_trampolines,
debug: dwarf,
got: None,
})
}
}
Expand Down
5 changes: 4 additions & 1 deletion lib/compiler-llvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ version.workspace = true

[dependencies]
wasmer-compiler = { path = "../compiler", version = "=5.0.2", features = [
"translator", "compiler"
"translator",
"compiler",
] }
wasmer-vm = { path = "../vm", version = "=5.0.2" }
wasmer-types = { path = "../types", version = "=5.0.2" }
Expand All @@ -26,6 +27,8 @@ libc.workspace = true
byteorder = "1"
itertools = "0.10"
rayon = "1.5"
phf = { version = "0.11.2", features = ["macros"] }
tracing = { version = "0.1", default-features = false, features = ["log"] }

[dependencies.inkwell]
package = "inkwell"
Expand Down
Loading

0 comments on commit 77e21da

Please sign in to comment.