Dealing with prefer-dynamic and runtime libraries

I have a crate that is built with prefer_dynamic flag. Building and running through cargo works fine, but just launching the executable does not work. I have a script to launch the executable that sets LD_LIBRARY_PATH, so it can link to my so objects. In addition to that I have a build script that scans the filesystem for toolchains and adds them to executable rpath. This approach works, but obviously I wont be able to deploy this. I know that ABI is not stable, so I guess I will have to deploy runtime libraries with my binary? What is the best way to copy runtime libraries to my target-dir? is there any builtin solutions for that? Is there a post build script to use ldd on the executable, so I can see which runtime libraries where not linked and copy them?

Is libstd the only runtime library I need? Or at some point the executable will require something else?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.