Cisco-Talos / clamav

ClamAV - Documentation is here: https://docs.clamav.net
https://www.clamav.net/
GNU General Public License v2.0
4.28k stars 692 forks source link

] Linking C executable check_fpu_endian ld: warning: ignoring duplicate libraries: '-lSystem', '-lm' ld: file cannot be mmap()ed, errno=22 path=../clamav-build/check/lib in '../clamav-build/check/lib' clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [unit_tests/check_fpu_endian] Error 1 make[1]: *** [unit_tests/CMakeFiles/check_fpu_endian.dir/all] Error 2 make: *** [all] Error 2 #1202

Open Rishabhsingh12180 opened 6 months ago

Rishabhsingh12180 commented 6 months ago

I cloned this repository on my system then generated build files with the help of CMake on MacOS VM setup on VMWare workstation 17.After that when I am building clamav on my VM through make command I am getting above error.Can anyone help me? my macos vm version is sonoma. Screenshot 2024-03-11 at 14 26 53

ragusaa commented 6 months ago

Hi,

Could you tell me what cmake command you ran?

Thanks, Andy

Rishabhsingh12180 commented 6 months ago

I ran make command to build clamav.First I cloned repo then created a build directory.Inside that directory I ran below command to generate build files rishabhsingh@Rishabhs-Mac check % cmake -DLIBCHECK_INCLUDE_DIR=/Users/rishabhsingh/check/src -DLIBCHECK_LIBRARY=/Users/rishabhsingh/check/lib -DOPENSSL_ROOT_DIR=/usr/local/openssl -DJSONC_LIBRARIES=/path/to/jsonc/lib/libjsonc.dylib -DJSONC_INCLUDE_DIRS=/path/to/jsonc/include /Users/rishabhsingh/clamav .After that inside clamav directory I ran make command which gave above error

ragusaa commented 6 months ago

for cmake, I am running 'cmake -G Ninja .. -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl' with no issues.

It looks like the actual error you are getting is 'ld: file cannot be mmap()ed, errno=22'. Error 22 is "Invalid argument passed to ld".

Are you able to run 'make -v', and get the actual command passed to ld? Running that by hand should help narrow down what is going on.

Rishabhsingh12180 commented 6 months ago

Did you run above command on vm or actual systen

ragusaa commented 6 months ago

Sorry for the late reply, I ran it on my actual mac system.