Closed cssivision closed 7 years ago
Is it possible to make one static linked library for all linux destributions??
yes, though the process is verbose..., especially build openssl as a static linked library. suggest you use this https://github.com/emk/rust-musl-builder, and be carefully of the openssl issues https://github.com/emk/rust-musl-builder/issues/21, i think i can produce a pr to do this.
Sure. But you have to keep the original build process, which will uses the system-wide openssl and libsodium.
i think i can fix this.
We could learn from rustup
how to do static link openssl : https://github.com/rust-lang-nursery/rustup.rs/blob/master/ci/run-docker.sh#L166-L193
I tested in my project, works well.
successfully build a static linked binary, the difficulty is building libsodium as a static linked library.
it's seems that crate sodiumoxide
has a bug for build a static library, the env variable SODIUM_LIB_DIR
is alway wrong, here.
i hardcode the static linked library path to bypass this problem. i will also fire a pr to sodiumoxide
.
i build everything from scratch, it has nothing to do with sodiumoxide
. i make a mistake in the env variable the first time, and cargo
cache the result for me, when i built without cache, i works fine. i don't know whether this is a bug in cargo.
Merged. Closing this issue.
I have added a helper script: https://github.com/shadowsocks/shadowsocks-rust/blob/master/build/build-release . Please help to check if it works in your environment. @cssivision
yes, it works well in my centos 7 server.
i think we should produce a static linked binary, so that we are ready to distribute it to
all
linux distributions.Is it necessary? i think i can produce PR to do this. @zonyitoo