rbpkrltd / yara-project

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

Unable to _build_ yara 1.6 or HEAD on OpenBSD i386 #64

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run 'CPPFLAGS="-I /usr/local/include" LDFLAGS="-L /usr/local/lib" 
./configure' to configure sources for build from yara 1.6 sources -- see issue 
#63
2. Run 'make' or 'gmake' to build

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

Expect to see make complete successfully. Instead the following errors occur:

/bin/sh ../libtool --tag=CXX   --mode=link g++  -g -O2  -L /usr/local/lib -o 
libregex.la  regex-pcre.lo  -lpcre
libtool: link: require no space between `-L' and `/usr/local/lib'
gmake[4]: *** [libregex.la] Error 1
gmake[4]: Leaving directory `/home/dspruell/downloads/yara-1.6/libyara/regex'
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory `/home/dspruell/downloads/yara-1.6/libyara'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/home/dspruell/downloads/yara-1.6/libyara'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/home/dspruell/downloads/yara-1.6'
gmake: *** [all] Error 2

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

OpenBSD 5.1 i386
libtool (GNU libtool) 2.4.2
yara 1.6
pcre 8.21
re2 library current from 2012-9-3

Please provide any additional information below.

After successful ./configure, the string:

LDFLAGS = -L /usr/local/lib

...is found in the following makefiles:

String '-L /usr/local/lib' showed in files:

./libyara/regex/Makefile
./libyara/Makefile
./Makefile

Editing these files to remove the space between '-L' and '/usr/local/lib' as 
follows allows the make to proceed further:

LDFLAGS = -L/usr/local/lib

This occurs with both the builtin make and GNU make (gmake).

After repairing Makefile(s), the build continues further but then fails with 
the following:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I /usr/local/include -g -O2 -MT 
proc.lo -MD -MP -MF .deps/proc.Tpo -c proc.c  -fP
IC -DPIC -o .libs/proc.o
proc.c: In function 'get_process_memory':
proc.c:245: error: 'PTRACE_ATTACH' undeclared (first use in this function)
proc.c:245: error: (Each undeclared identifier is reported only once
proc.c:245: error: for each function it appears in.)
proc.c:288: error: 'PTRACE_DETACH' undeclared (first use in this function)
gmake[4]: *** [proc.lo] Error 1
gmake[4]: Leaving directory `/home/dspruell/downloads/yara-1.6/libyara'
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory `/home/dspruell/downloads/yara-1.6/libyara'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/home/dspruell/downloads/yara-1.6/libyara'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/home/dspruell/downloads/yara-1.6'
gmake: *** [all] Error 2

I'm able to work around this with the following change:

--- libyara/proc.c.bak  Tue Sep  4 02:16:18 2012
+++ libyara/proc.c      Tue Sep  4 02:19:21 2012
@@ -122,7 +122,7 @@
 #include "mem.h"
 #include "proc.h"

-#if defined(__FreeBSD__) || defined(__MACH__)
+#if defined(__FreeBSD__) || defined(__MACH__) || defined(__OpenBSD__)
 #define PTRACE_ATTACH PT_ATTACH
 #define PTRACE_DETACH PT_DETACH
 #endif

After this, the build completes.

Original issue reported on code.google.com by phatbuck...@gmail.com on 4 Sep 2012 at 9:26