yara-rust icon indicating copy to clipboard operation
yara-rust copied to clipboard

Provides better linking default and options

Open Hugal31 opened this issue 5 years ago • 3 comments

This blog post describe some reasonable behaviors for -sys crates : https://kornel.ski/rust-sys-crate. Implement them.

Hugal31 avatar Apr 15 '20 08:04 Hugal31

@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 avatar Sep 08 '20 08:09 Hugal31

@Hugal31 If I understand correctly, can we close this one?

ikrivosheev avatar Aug 20 '22 12:08 ikrivosheev

Well, I still have link issues when trying to link statically. Does it work on your setup?

Hugal31 avatar Aug 22 '22 07:08 Hugal31