meilisearch / heed

A fully typed LMDB wrapper with minimum overhead 🐦

Home Page:https://docs.rs/heed

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: does the build executable binary rely on a dynamic linked liblmdb library?

linrongbin16 opened this issue · comments

Hi, I just want to confirm, when using this library in a single-binary rust project.

Does the final built executable binary rely on a dynamic linked liblmdb library?

Because usually in C/C++ project, this will happen, I'm not quite sure about the cargo build behavior.

I found that cargo build will by default build a static executable (except the glibc on linux, and the crt runtime on Windows), but how about third party C source code like the lmdb-master-sys in this project?

You can easily check using ldd:

$ ldd target/release/<your-executable>
	linux-vdso.so.1 (0x00007ffddbd24000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd87bcd4000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd87b915000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd87b600000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fd87bd10000)

There is no reference to libmdb, so it is statically linked (except libc and co.)

Thank you!