Skip to content

Commit 1a00048

Browse files
committed
Fix macOS N-API linking by allowing undefined symbols
Add -undefined dynamic_lookup linker flags for macOS targets to allow N-API symbols to be resolved at runtime by Node.js instead of failing at build time.
1 parent 06cb0ae commit 1a00048

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.cargo/config.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
[target.x86_64-apple-darwin]
2+
rustflags = ["-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup"]
3+
4+
[target.aarch64-apple-darwin]
5+
rustflags = ["-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup"]
6+
17
[target.aarch64-unknown-linux-musl]
28
linker = "aarch64-alpine-linux-musl-gcc"
39
rustflags = ["-C", "target-feature=-crt-static"]

0 commit comments

Comments
 (0)