Open GoogleCodeExporter opened 9 years ago
This is not a defect in Yara, but rather user error in your OS's package
management.
I'm not sure if this is the same under OpenBSD, but in Ubuntu, you must also
install the "libpcre3-dev" package in addition to the libraries. This contains
the header files that the configure script is looking for to verify if the
libraries are installed. In this case, it is looking for /usr/include/pcre.h
which is part of the libpcre3-dev package not the main libpcre3 package (in
Ubuntu).
Things might be slightly different in OpenBSD. You may need to make sure that
some setting is made in the port to make sure that it installs header files in
/usr/include or wherever it keeps those header files.
Original comment by rsimmo...@gmail.com
on 1 May 2013 at 5:33
You mean this header file?
$ pkg_info -L pcre |grep 'pcre\.h$'
/usr/local/include/pcre.h
$ ls -l /usr/local/include/pcre.h
-r--r--r-- 1 root bin 23188 Aug 3 2012 /usr/local/include/pcre.h
Seems kosher.
OpenBSD does not separate development parts from main parts in their packages.
It tends to avoid the issues referred to in comment #1.
Original comment by phatbuck...@gmail.com
on 2 May 2013 at 4:47
Trying again using yara 1.7 on OpenBSD 5.2 i386.
$ ./configure
...
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... openbsd5.2 ld.so
checking how to hardcode library paths into programs... immediate
checking dependency style of g++... gcc3
checking for main in -lpcre... no
configure: error: please install PCRE library
(Exits status 1).
$ ./configure --with-re2
...
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... openbsd5.2 ld.so
checking how to hardcode library paths into programs... immediate
checking dependency style of g++... gcc3
checking for main in -lre2... no
configure: error: please install RE2 library
(Exits status 1).
$ ldconfig -r |grep re2
231:-lre2.0.0 => /usr/local/lib/libre2.so.0.0.0
$ ls -l /usr/local/include/re2/
total 128
-rw-r--r-- 1 root wheel 3573 May 1 22:48 filtered_re2.h
-rw-r--r-- 1 root wheel 33985 May 1 22:48 re2.h
-rw-r--r-- 1 root wheel 1688 May 1 22:48 set.h
-rw-r--r-- 1 root wheel 5851 May 1 22:48 stringpiece.h
-rw-r--r-- 1 root wheel 16675 May 1 22:48 variadic_function.h
$ CPPFLAGS="-I /usr/local/include/re2" LDFLAGS="-L /usr/local/lib" ./configure
--with-re2
...
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... openbsd5.2 ld.so
checking how to hardcode library paths into programs... immediate
checking dependency style of g++... gcc3
checking for main in -lre2... no
configure: error: please install RE2 library
(Exits status 1).
In config.log:
...
configure:15466: checking for main in -lre2
configure:15485: g++ -o conftest -g -O2 -I/usr/local/include/re2
-L/usr/local/lib conftest.cpp -lre2 >&5
/usr/local/lib/libre2.so: warning: sprintf() is often misused, please use
snprintf()
/usr/local/lib/libre2.so: undefined reference to `pthread_rwlock_rdlock'
/usr/local/lib/libre2.so: undefined reference to `pthread_rwlock_init'
/usr/local/lib/libre2.so: undefined reference to `pthread_rwlock_destroy'
/usr/local/lib/libre2.so: undefined reference to `pthread_rwlock_unlock'
/usr/local/lib/libre2.so: undefined reference to `pthread_rwlock_wrlock'
/usr/local/lib/libre2.so: undefined reference to `pthread_mutex_unlock'
/usr/local/lib/libre2.so: undefined reference to `pthread_mutex_lock'
collect2: ld returned 1 exit status
configure:15485: $? = 1
$ file /usr/local/lib/libre2.so.0.0.0
/usr/local/lib/libre2.so.0.0.0: ELF 32-bit LSB shared object, Intel 80386,
version 1, for OpenBSD, dynamically linked, not stripped
$ objdump -t /usr/local/lib/libre2.so.0.0.0 |grep -i pthread
00000000 *UND* 00000000 pthread_rwlock_rdlock
00000000 *UND* 00000000 pthread_rwlock_init
00000000 w *UND* 00000000 pthread_cancel
00000000 *UND* 00000000 pthread_rwlock_destroy
00000000 *UND* 00000000 pthread_rwlock_unlock
00000000 *UND* 00000000 pthread_rwlock_wrlock
00000000 *UND* 00000000 pthread_mutex_unlock
00000000 *UND* 00000000 pthread_mutex_lock
Issue with RE2 library linking against pthread? I don't really understand from
here.
Original comment by phatbuck...@gmail.com
on 2 May 2013 at 8:42
Had the same issue then ran this command:
sudo apt-get install libpcre3 libpcre3-dev
Must have been missing a lib.
Ran ./configure and it worked.
Original comment by rkeq0...@gmail.com
on 27 Jun 2013 at 4:59
[deleted comment]
For some reason the below flags are not set correctly. Export before calling
configure should work.
$> export LDFLAGS="-L/usr/local/lib"
$> export CFLAGS=-I/usr/local/include
$> ./configure
Original comment by info.var...@gmail.com
on 8 Oct 2013 at 9:59
Original issue reported on code.google.com by
phatbuck...@gmail.com
on 4 Sep 2012 at 8:51