Created attachment 174688 [details] Build log FreeBSD scorpio.seibercom.net 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r296485: Tue Mar 8 07:04:36 UTC 2016 The build process ends with this error message: ===> Building for yara-3.5.0 /usr/bin/make all-recursive Making all in libyara depbase=`echo modules/tests.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`; /bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -O3 -Wall -Wno-deprecated-declarations -std=gnu99 -I./include -fvisibility=hidden -O2 -pipe -fstack-protector -fno-strict-aliasing -D_THREAD_SAFE -pthread -DHASH_MODULE -MT modules/tests.lo -MD -MP -MF $depbase.Tpo -c -o modules/tests.lo modules/tests.c && mv -f $depbase.Tpo $depbase.Plo libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -O3 -Wall -Wno-deprecated-declarations -std=gnu99 -I./include -fvisibility=hidden -O2 -pipe -fstack-protector -fno-strict-aliasing -D_THREAD_SAFE -pthread -DHASH_MODULE -MT modules/tests.lo -MD -MP -MF modules/.deps/tests.Tpo -c modules/tests.c -fPIC -DPIC -o modules/.libs/tests.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -O3 -Wall -Wno-deprecated-declarations -std=gnu99 -I./include -fvisibility=hidden -O2 -pipe -fstack-protector -fno-strict-aliasing -D_THREAD_SAFE -pthread -DHASH_MODULE -MT modules/tests.lo -MD -MP -MF modules/.deps/tests.Tpo -c modules/tests.c -o modules/tests.o >/dev/null 2>&1 depbase=`echo modules/pe.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`; /bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -O3 -Wall -Wno-deprecated-declarations -std=gnu99 -I./include -fvisibility=hidden -O2 -pipe -fstack-protector -fno-strict-aliasing -D_THREAD_SAFE -pthread -DHASH_MODULE -MT modules/pe.lo -MD -MP -MF $depbase.Tpo -c -o modules/pe.lo modules/pe.c && mv -f $depbase.Tpo $depbase.Plo libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -O3 -Wall -Wno-deprecated-declarations -std=gnu99 -I./include -fvisibility=hidden -O2 -pipe -fstack-protector -fno-strict-aliasing -D_THREAD_SAFE -pthread -DHASH_MODULE -MT modules/pe.lo -MD -MP -MF modules/.deps/pe.Tpo -c modules/pe.c -fPIC -DPIC -o modules/.libs/pe.o ESC[1mmodules/pe.c:2280:3: ESC[0mESC[0;1;31merror: ESC[0mESC[1muse of undeclared identifier 'YR_MEMORY_BLOCK_ITERATOR'ESC[0m YR_MEMORY_BLOCK_ITERATOR* iterator = context->iterator; ESC[0;1;32m ^ ESC[0mESC[1mmodules/pe.c:2280:29: ESC[0mESC[0;1;31merror: ESC[0mESC[1muse of undeclared identifier 'iterator'ESC[0m YR_MEMORY_BLOCK_ITERATOR* iterator = context->iterator; ESC[0;1;32m ^ ESC[0mESC[1mmodules/pe.c:2280:49: ESC[0mESC[0;1;31merror: ESC[0mESC[1mno member named 'iterator' in 'struct _YR_SCAN_CONTEXT'ESC[0m YR_MEMORY_BLOCK_ITERATOR* iterator = context->iterator; ESC[0;1;32m ~~~~~~~ ^ ESC[0mESC[1mmodules/pe.c:2525:24: ESC[0mESC[0;1;31merror: ESC[0mESC[1muse of undeclared identifier 'iterator'ESC[0m foreach_memory_block(iterator, block) ESC[0;1;32m ^ ESC[0mESC[1mmodules/pe.c:2527:22: ESC[0mESC[0;1;31merror: ESC[0mESC[1mno member named 'fetch_data' in 'struct _YR_MEMORY_BLOCK'ESC[0m block_data = block->fetch_data(block); ESC[0;1;32m ~~~~~ ^ ESC[0m5 errors generated. *** Error code 1 Stop. make[3]: stopped in /usr/ports/security/yara/work/yara-3.5.0/libyara *** Error code 1 Stop. make[2]: stopped in /usr/ports/security/yara/work/yara-3.5.0 *** Error code 1 Stop. make[1]: stopped in /usr/ports/security/yara/work/yara-3.5.0 *** Error code 1 Stop. make: stopped in /usr/ports/security/yara Script done on Mon Sep 12 12:00:46 2016 The build log is attached.
I got an another error: libyara/.libs/libyara.a(pe.o): In function `pe_parse_certificates': modules/pe.c:(.text+0x42eb): undefined reference to `X509_get_signature_nid' --- yara --- libyara/.libs/libyara.a(pe.o): In function `pe_parse_certificates': modules/pe.c:(.text+0x42eb): undefined reference to `X509_get_signature_nid' --- yarac --- cc: error: linker command failed with exit code 1 (use -v to see invocation) *** [yarac] Error code 1 I could fix this comment out CPPFLAGS+= -I${OPENSSLINC} LIBS+= -L${OPENSSLLIB} in the Makefile. (10.3 with libressl).
Yara upstream doesn't support libressl (yet?).
The original comment looks like it is picking up a header from a previous install and using that over the included headers when building?
Created attachment 175019 [details] yara.diff Gerard: Do you have both a previous version of yara and openssl from ports installed? Can you try attached patch? It will prefer yara includes from sources over installed yara includes from a previous version.
Created attachment 175020 [details] yara.diff v2 New version: - prefer yara headers from sources over installed headers from a previous version - fix build with libressl (build tested only)
(In reply to Antoine Brodin from comment #5) I installed the patch and now the port builds and installs correctly.
Please commit, and feel free to take ownership too as I am severely time limited lately. :(
(In reply to Wesley Shields from comment #7) Unfortunately, I have neither the time nor the technical skill to maintain this port. Perhaps someone else can take it?
I'll be happy to maintain it until a suitable replacement comes along, if you are willing to commit this diff. ;) Gerard, would you like to maintain it? Otherwise I'll keep it until I can find someone.
A commit references this bug: Author: antoine Date: Wed Sep 21 15:11:37 UTC 2016 New revision: 422564 URL: https://svnweb.freebsd.org/changeset/ports/422564 Log: - Fix build when a previous version is insalled and ssl from ports is used - Fix build with libressl - Take maintainership PR: 212610 Approved by: wxs (maintainer) Changes: head/security/yara/Makefile head/security/yara/files/ head/security/yara/files/patch-libyara_modules_pe.c
Oops, I misread who the comment was from earlier. Sorry for the confusion Gerard, and thank you Antoine for picking it up!