Hi, I’m trying to use musl to compile my rust library to a statically linked library.
And then converting it to a shared lib using:
musl-gcc -shared -o libexample.so -Wl,–whole-archive libexample.a
hoping to compile an executable library that can be portable on most linux platforms without glibc dependency, and let other languages call into the library.
Is this even possible?
I’m running into lots of errors when converting with multiple definition error.
i used CFLAGS=-fPIC for the musl compilation. everything else was pretty much the same as https://doc.rust-lang.org/book/advanced-linking.html#static-linking
ldd (Ubuntu GLIBC 2.23-0ubuntu3) 2.23
rustc 1.12.0-nightly (27e766d7b 2016-07-19)
cargo 0.13.0-nightly (664125b 2016-07-19)