From 5bca8371daed9b66abb0579aa0034cf6ecb3c85f Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sun, 20 Dec 2020 10:30:48 -0500 Subject: [PATCH] Document that macOS linker flags apply on aarch64 as well --- README.md | 6 ++++++ src/lib.rs | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/README.md b/README.md index 13330a13..fa228b9a 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,12 @@ rustflags = [ "-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup", ] + +[target.aarch64-apple-darwin] +rustflags = [ + "-C", "link-arg=-undefined", + "-C", "link-arg=dynamic_lookup", +] ``` While developing, you can symlink (or copy) and rename the shared library from the target folder: On MacOS, rename `libstring_sum.dylib` to `string_sum.so`, on Windows `libstring_sum.dll` to `string_sum.pyd`, and on Linux `libstring_sum.so` to `string_sum.so`. Then open a Python shell in the same folder and you'll be able to `import string_sum`. diff --git a/src/lib.rs b/src/lib.rs index 09222c05..b421391f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -90,6 +90,12 @@ //! "-C", "link-arg=-undefined", //! "-C", "link-arg=dynamic_lookup", //! ] +//! +//! [target.aarch64-apple-darwin] +//! rustflags = [ +//! "-C", "link-arg=-undefined", +//! "-C", "link-arg=dynamic_lookup", +//! ] //! ``` //! //! While developing, you symlink (or copy) and rename the shared library from