yara-rust
yara-rust copied to clipboard
Provides better linking default and options
This blog post describe some reasonable behaviors for -sys crates : https://kornel.ski/rust-sys-crate. Implement them.
@rc-grey added a LIBYARA_STATIC environment variable to make Yara link statically, but I didn't managed to make it work. I have some link errors when building the tests:
> YARA_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu LIBYARA_STATIC=1 cargo test
...
/usr/bin/ld: (.text+0x123d): undefined reference to `MD5_Update'
/usr/bin/ld: (.text+0x1299): undefined reference to `MD5_Final'
/usr/bin/ld: /home/laloge_h/sources/perso/yara-rust/target/debug/deps/libyara_sys-6d57026986dabd21.rlib(pe.o): in function `pe_parse_certificates':
(.text+0x2ffd): undefined reference to `BIO_new_mem_buf'
/usr/bin/ld: (.text+0x3011): undefined reference to `d2i_PKCS7_bio'
/usr/bin/ld: (.text+0x3022): undefined reference to `PKCS7_get0_signers'
/usr/bin/ld: (.text+0x3046): undefined reference to `OPENSSL_sk_num'
...
@Hugal31 If I understand correctly, can we close this one?
Well, I still have link issues when trying to link statically. Does it work on your setup?