odin1314 / yara-project

Automatically exported from code.google.com/p/yara-project
Apache License 2.0
0 stars 0 forks source link

Yara does not compile properly by default under Win7x64 (cygwin) #25

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Untar Yara 1.5 distribution  under /tmp
2.Run ./configure
3.Run make

What is the expected output? What do you see instead?

     Make proceeds normally until it attempts to compile proc.c. It then errors out with the following:

          /bin/sh ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.     -g -O2 -MT proc.lo -MD -MP -MF .deps/proc.Tpo -c -o proc.lo proc.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -g -O2 -MT proc.lo -MD -MP -MF 
.deps/proc.Tpo -c proc.c  -DDLL_EXPORT -DPIC -o .libs/proc.o
          proc.c:119:24: error: sys/ptrace.h: No such file or directory
          proc.c: In function `get_process_memory':
          proc.c:244: error: `PTRACE_ATTACH' undeclared (first use in this function)
          proc.c:244: error: (Each undeclared identifier is reported only once
          proc.c:244: error: for each function it appears in.)
          proc.c:287: error: `PTRACE_DETACH' undeclared (first use in this function)
          make[4]: *** [proc.lo] Error 1
          make[4]: Leaving directory `/tmp/yara-1.5/libyara'
          make[3]: *** [all-recursive] Error 1
          make[3]: Leaving directory `/tmp/yara-1.5/libyara'
          make[2]: *** [all] Error 2
          make[2]: Leaving directory `/tmp/yara-1.5/libyara'
          make[1]: *** [all-recursive] Error 1
          make[1]: Leaving directory `/tmp/yara-1.5'
          make: *** [all] Error 2

What version of the product are you using? On what operating system?

Yaraq 1.5, under Windows 7x64 (cygwin)

Please provide any additional information below.

Compilation seems to be failing because WIN32 is not defined in proc.c. This is 
defined in several different cygwin include files. I tried manually including 
one of these, /usr/include/w32api/windef.h, in proc.c. Subsequent compilation  
was successful, and the application appeared to work correctly.

Original issue reported on code.google.com by johnmcca...@gmail.com on 27 Jun 2011 at 2:04

GoogleCodeExporter commented 9 years ago
Should be fixed in version 1.6.

Original comment by plus...@gmail.com on 4 Aug 2011 at 11:59

GoogleCodeExporter commented 9 years ago
My apologies. I hardly ever check this email account. Just tried to install
yara-1.6 & discovered that this issue doesn't appear to be fixed. Then I
went back and noticed the messages in this account. Please send any followup
email to john.mccash@motorolasolutions.com. I applied the same fix as
before, including /usr/include/w32api/windef.h at the beginning of proc.c,
and this allowed the compilation to complete successfully.
     John

Original comment by johnmcca...@gmail.com on 6 Oct 2011 at 2:52

GoogleCodeExporter commented 9 years ago
Issue still not fixed in yara-1.7. Went back and applied same fix as before, 
inserting the following line at the beginning of proc.c:

#include "/usr/include/w32api/windef.h"

Compilation then proceeds successfuly.
John

Original comment by johnmcca...@gmail.com on 23 Apr 2013 at 6:01

GoogleCodeExporter commented 9 years ago
Another update... I updated to the most recent version of Cygwin, and 
recompiled yara again yesterday. This time the above include didn't work. 
However explicitly doing

#define WIN32

at the beginning of proc.c did. I believe this is the key define that wasn't 
being set before, as well. Mind you, I have no idea where it's really supposed 
to be getting set. This may really be a cygwin bug. Nonetheless, I wish you 
guys would put in some code to address it.

Thanks
John

Original comment by johnmcca...@gmail.com on 24 Apr 2013 at 4:42

GoogleCodeExporter commented 9 years ago
im trying to compile yara-1.7 and tried with yara-1.6 on cygwin 2.7 and im 
still getting this same error. i included in the proc.c file the 
/usr/include/w32api/windef.h
but it doesn't seem to work.....any ideas?

Original comment by adime...@gmail.com on 11 Jul 2013 at 11:58