Adapt to new rustc-cdylib-link-arg parameter#6
Adapt to new rustc-cdylib-link-arg parameter#6lrascao wants to merge 1 commit intorusterlium:masterfrom
Conversation
After rust-lang/rust/pull/36574 has been merged the latest Rust version 1.49 breaks the linking of dynamic libs in MacOS. These changes ensure that the extra link args are applied only at the dynamic lib generation linking step.
|
This depends on rusterlium/erlang-cargo#9, once that's merged and published to hex this one can updated |
|
Do you have an example of the breakage? The PR you are mentioning was merged over 5 years ago. I would really like to prevent the necessity of a |
|
ah right, i've probably linked the wrong one, can't seem to find it now.. |
|
@lrascao Would you update this MR? |
|
👍🏻 will do |
|
@lrascao @belltoy The Also of note, the |
|
That is to say, I can get things linked correctly by specifying I also noticed the switch from |
|
If anyone cares, here's my minimal working example that works on macOS without issue: https://github.com/davisp/rust-nif-examples Once rebar3_cargo is updated I'll remove the hacky forked version. |
|
Thank you @davisp for pointing out these. Actually, there are no too many differences between On macOS, we need to tell the rust compiler the additional link args, via one of three methods:
The differences of all these three methods are:
I think the choice should let the NIF author make. But as @davisp mentioned, If use TOML config or Notice that the
So if you use this, you should set the crate type to The best choice for now in my opinion is to use the new |
|
How is going? |
|
sorry, not enough bandwidth to pick this up, feel free to take over if it's urgent to you |
After rust-lang/rust/pull/36574 has been merged the latest Rust
version 1.49 breaks the linking of dynamic libs in MacOS. These
changes ensure that the extra link args are applied only at the
dynamic lib generation linking step.