If the converters/libiconv port is installed, security/hashcat (3.6.0) has the following error:
cc -O2 -pipe -fstack-protector -isystem /usr/local/include -fno-strict-aliasing -std=c99 -Iinclude -IOpenCL -Iinclude/lzma_sdk src/main.c libhashcat.so -L. -lhashcat -fstack-protector -lpthread -DCOMPTIME=1497244702 -DVERSION_TAG=\"pull/1273/head\" -DINSTALL_FOLDER=\"/usr/local/bin\" -DSHARED_FOLDER=\"/usr/local/share/hashcat\" -DDOCUMENT_FOLDER=\"/usr/local/share/doc/hashcat\" -o hashcat
libhashcat.so: undefined reference to `libiconv'
libhashcat.so: undefined reference to `libiconv_close'
libhashcat.so: undefined reference to `libiconv_open'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake: *** [src/Makefile:394: hashcat] Error 1
This is because the compilation looks in /usr/local/include first (due to USES=localbase) when building a couple .c files that include iconv.h
Noticed on 10.x and 11.x.
Created attachment 183422 [details]
[patch] try to force including base iconv.h in case /usr/local/include/iconv.h exists
This possible patch forces /usr/include to be searched before /usr/local/include. Thus /usr/include/iconv.h will be found before /usr/local/include/iconv.h and the references to libiconv_* symbols becomes iconv_* (satisfied by /usr/lib/libiconv.so that is in all supported OS versions - i.e., basically 10.x+ now).
Created attachment 183427 [details]
[patch] add USES=iconv
This patch adds USES=iconv instead. I think this is better than forcing /usr/include before /usr/local/include.
This will have the effect of adding converters/libiconv to BUILD_DEPENDS if converters/libiconv is installed due to the current Uses/iconv.mk. But that's just a BUILD_DEPEND (can be removed after build), and I think Uses/iconv.mk could be altered to not force that BUILD_DEPEND addition (separate patch sent to tijl@).
I like the USES=iconv approach.
Let me test a couple of things and I'll get it in.
A commit references this bug:
Date: Mon Jun 12 21:53:05 UTC 2017
New revision: 443471
fix build with libiconv installed by USES=iconv
Submitted by: John Hein <email@example.com>