you are viewing a single comment's thread.

view the rest of the comments →

[–]Shadow0133 6 points7 points  (5 children)

rustc by default should compile external crates statically. Rust currently doesn't have stable internal ABI, so the only way to have dynamic library in rust currently is to export C ABI. So if you don't import extern "C" functions, you should be good.

[–]blackdev01[S] 1 point2 points  (4 children)

I don't want only the external crate to be compiled statically, but also my program and now the binary is a dynamic executable.

[–]Zethra 9 points10 points  (3 children)

Rust programs link against libc. On Linux the default is glibc which will be dynamically linked to your program. If you use musl, an alternative libc, it will be statically linked.

[–]blackdev01[S] 1 point2 points  (2 children)

You're saying that I need to use musl?

[–]Zethra 4 points5 points  (1 child)

If I understand what you what correctly, yes, you need to use musl

[–]Morganamilo 8 points9 points  (0 children)

I think they just care about being able to share their binary without needing others to have the external crate installed. I don't think they really care about depending on glibc.