3 ms·
Name resolution libraries are loaded dynamically [1,2], so glibc can't be linked statically if you want NSS to work. I gather there might be a way to explicitly
by spystath 12y ago
Name resolution libraries are loaded dynamically [1,2], so glibc can't be linked statically if you want NSS to work. I gather there might be a way to explicitly link to a specific resolution library but this is practically unsupported/poorly documented.
[1]: https://sourceware.org/glibc/wiki/FAQ#Even_statically_linked_programs_need_some_shared_libraries_which_is_not_acceptable_for_me.__What_can_I_do.3F https://sourceware.org/glibc/wiki/FAQ#Even_statically_linked...
[2]: http://stackoverflow.com/questions/3430400/linux-static-linking-is-dead http://stackoverflow.com/questions/3430400/linux-static-link...
- xyzzy_plugh 12y agoI understand this limitation. I can currently get around this by using --enable-static-nss. Does rust currently expose any way to do this? Could I perform linking myself as a workaround?
- steveklabnik 12y ago> Could I perform linking myself as a workaround? You can but it requires lots of black magic, and certainly a nightly rather than beta Rust ;) http://mainisusuallyafunction.blogspot.com/2015/01/151-byte-static-linux-binary-in-rust.html http://mainisusuallyafunction.blogspot.com/2015/01/151-byte-... is an old blog post that can get you started.
- xyzzy_plugh 12y agoWonderful -- thanks Steve! Best of luck on the upcoming release.