Skip to content

Commit

Permalink
Add linker directive for *-darwin to fix PyO3
Browse files Browse the repository at this point in the history
Without these flags I get linking errors like this when building from
nixpkgs:

  = note: Undefined symbols for architecture arm64:
            "_PyExc_ConnectionResetError", referenced from:
                pyo3::type_object::PyTypeInfo::type_object::hd73bc9c256c52717 in libpyo3-c59aeb8b74bb57e0.rlib(pyo3-c59aeb8b74bb57e0.pyo3.e60578ba-cgu.0.rcgu.o)

See: https://pyo3.rs/main/building_and_distribution#macos
  • Loading branch information
nrhtr committed Jul 15, 2023
1 parent 396d8b3 commit 5f5a994
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[target.x86_64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]

[target.aarch64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]

0 comments on commit 5f5a994

Please sign in to comment.