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

Fails to compile on x86 and arm

Open russellbanks opened this issue 1 year ago • 4 comments

Compiling an application that uses this library fails on x86 and arm targets due to Wasmtime. I've tested this on i686-pc-windows-msvc, i686-unknown-linux-gnu, armv7-unknown-linux-gnueabihf, and i686-unknown-freebsd.

On x86 architectures, the build for wasmtime with no 'asm_sym' in the root or Wasmtime is being compiled for an architecture that it does not support.

On arm architectures, the build for cranelift-codegen fails with no supported isa found for arch 'armv7'.

  • https://github.com/bytecodealliance/wasmtime/issues/1980
  • https://github.com/bytecodealliance/wasmtime/issues/1173
  • https://github.com/bytecodealliance/wasmtime/issues/7924

russellbanks avatar May 17 '24 10:05 russellbanks

Yep, that's a known issue. If wasmtime adds support for these platforms that would be great, if not, we must live without support for them. To be honest, I'm not very worried about not supporting those old platforms. Most users nowadays have 64-bits machines.

However, I would like to improve the experience for any developer that wants to depend on the yara-x crate, at least by breaking the compilation with a more explicative message in those unsupported platforms. Also, if you are only using this crate for the yara_x::mods::invoke feature, wasmtime is not really needed at all, and I think I may do something for supporting that feature in all platforms. Are you in this case? Or you plan to use the yara-x crate for scanning files with YARA rules?

plusvic avatar May 17 '24 13:05 plusvic

I personally just use yara_x::mods::invoke with the PE module to get resources, vs_version_info, etc, from PE files. I am considering looking into yara rules but currently, I just use the PE module.

russellbanks avatar May 17 '24 13:05 russellbanks

Do you actually need support for x86 and armv7? Or just wanted to give a heads up?

plusvic avatar May 17 '24 14:05 plusvic

It's not imperative but I aim for my application to build and be built on as many platforms and architectures as I can so my users can run it on any device.

russellbanks avatar May 17 '24 14:05 russellbanks

Closing because it's unfeasible to provide support for platforms that are not supported by wasmtime.

plusvic avatar Sep 06 '24 16:09 plusvic

32-bits architectures are supported after 344880a6146dd891b28edf954090a25f160ed7e6.

plusvic avatar Feb 24 '25 16:02 plusvic