VirusTotal / yara

The pattern matching swiss knife
https://virustotal.github.io/yara/
BSD 3-Clause "New" or "Revised" License
8.32k stars 1.45k forks source link

[Yara 4.5.0][Build error] --- pread64 not found on Alpine Linux #2050

Closed nivscadafence closed 7 months ago

nivscadafence commented 8 months ago

Yara build on Alpine Linux fails:

libyara/proc/linux.c: In function 'yr_process_fetch_memory_block_data': libyara/proc/linux.c:252:9: warning: implicit declaration of function 'pread64'; did you mean 'pread'? [-Wimplicit-function-declaration] 252 | if (pread64( | ^~~~~~~ | pread CCLD libyara.la copying selected object files to avoid basename conflicts... CCLD yara /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: ./.libs/libyara.so: undefined reference topread64' collect2: error: ld returned 1 exit status make[1]: [Makefile:1735: yara] Error 1 make[1]: Leaving directory '/tmp/sources/yara-4.5.0' make: [Makefile:1190: all] Error 2 The command '/bin/sh -c cd /tmp/sources && tar -zxf yara-${YARA_VERSION}.tar.gz && cd yara-${YARA_VERSION} && ./bootstrap.sh && ./configure --with-crypto --enable-magic && make && make install && make check' returned a non-zero code: 2`

vthib commented 8 months ago

On which version of Alpine do you have this issue?

This is very likely due to musl 1.2.4, a fix is in progress here: https://github.com/VirusTotal/yara/pull/2048

nivscadafence commented 8 months ago

docker image:

python:3.9-alpine

plusvic commented 7 months ago

Should be fixed in 833a580430abe0fbc9bc17a21fb95bf36dacf367

fwosar commented 6 months ago

Given that the build is broken on some non-MUSL systems right now as well, like ArchLinux for example, any chance for a point release that includes the fix that could be propagated to the various dependency managers, @plusvic?

plusvic commented 6 months ago

Yes, I think it's time for a new release.