Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add an environment variable for dynamic linking #77

Open
happysalada opened this issue Apr 24, 2022 · 1 comment
Open

add an environment variable for dynamic linking #77

happysalada opened this issue Apr 24, 2022 · 1 comment

Comments

@happysalada
Copy link

Hi, could we add an environment variable for dynamic linking?
Something that like CARGO_MIMALLOC_DYNAMIC_LINKING
that would do something akin to https://github.com/fede1024/rust-rdkafka/blob/master/rdkafka-sys/build.rs#L41
(finding the lib with pkg-config).
There might be a version mismatch, but there are several advantages.

  • you don't need to do the static build everytime for project in development (if your rust version changes or if you cargo clean).
  • some OS have a hard time with static compilation (in my case NixOS) because it has strict rules for dependencies. Since it can be found as a dependency already built in the OS, dynamic compilation would be best.

to give you a bit more context, I've tried to package something recently in rust that had a dependency on mimalloc_rust and had to give up (because compiling mimalloc has some dependencies not included when compiling for darwin).

@jianshu93
Copy link

I have the same issue here, for MacOS Darwin, static link is always very hard while dynamic link is preferred. I would love to see it working on MacOS.

Thanks,
Jianshu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants