I'm trying to compile security/suricata, and ran into problems when compiling devel/libhtp. No matter if I configure security/suricata to use suricata's builtin libhtp or to use devel/libhtp, both attempts fail with error messages such as: --- htp_transcoder.lo --- htp_transcoder.c:68:5: warning: implicit declaration of function 'iconvctl' is invalid in C99 [-Wimplicit-function-declaration] iconvctl(cd, ICONV_SET_TRANSLITERATE, &iconv_param); ^ htp_transcoder.c:68:18: error: use of undeclared identifier 'ICONV_SET_TRANSLITERATE' iconvctl(cd, ICONV_SET_TRANSLITERATE, &iconv_param); ^ htp_transcoder.c:70:18: error: use of undeclared identifier 'ICONV_SET_DISCARD_ILSEQ' iconvctl(cd, ICONV_SET_DISCARD_ILSEQ, &iconv_param); ^ 1 warning and 2 errors generated. *** [htp_transcoder.lo] Error code 1 make[3]: stopped in /usr/ports/workdirs/usr/ports/devel/libhtp/work/OISF-libhtp-4cb1b99/htp I even recompiled devel/libiconv and everything depending on that library, before attempting to compile devel/libhtp, but to no avail. My ports tree is currently at r377002, and the installed devel/libiconv is 1.14_6.
Auto-assigned to maintainer koobs@FreeBSD.org
This is on stable/10 amd64 r277210. Neither /etc/make.conf nor /etc/src.conf contains WITH_ICONV=yes, nor does these files contain WITHOUT_ICONV=yes. This is the contents of /etc/make.conf: CC=clang CXX=clang++ CPP=clang-cpp WITH_PKGNG=yes WITH_BDB6_PERMITTED=yes WITH_SSP_PORTS=yes WRKDIRPREFIX=/usr/ports/workdirs TEX_DEFAULT=texlive DEFAULT_VERSIONS=apache=2.4 bdb=5 firebird=2.5 gcc=4.8 lua=5.2 mysql=5.5 perl5=5.20 pgsql=9.3 php=5.4 python=2.7 python2=2.7 python3=3.4 ruby=1.9 tcltk=8.6 This is the contents of /etc/src.conf: NO_WERROR= WERROR= WITH_CLANG_EXTRAS=yes WITH_CLANG_FULL=yes WITH_CTF=yes WITH_GCC=yes WITH_GNUCXX=yes WITH_LIBCPLUSPLUS=yes WITH_LLDB=yes WITH_NAND=yes WITH_PKGTOOLS=yes Both /usr/include/iconv.h and /usr/local/include/iconv.h contains a declaration of iconvctl(), and definitions of ICONV_SET_TRANSLITERATE and ICONV_SET_DISCARD_ILSEQ. Why does configure claim iconv to be working when clang fails to see iconvctl(), ICONV_SET_TRANSLITERATE, and ICONV_SET_DISCARD_ILSEQ while compiling htp_transcoder.c?
I can't reproduce this myself on a 10-STABLE machine, but I do however note bug 186563 (fixed by adding USES=iconv:translit) and http://trac.osgeo.org/postgis/ticket/3003 which indicates a similar resolution. Can you try modifying the port to use USES:iconv:translit and report back on whether that fixes the issue for you please. If it turns out this is *still* an issue for you, and the above changes fixes it, then the question becomes why can it not be reproduced locally (since we're both testing against 10-STABLE
(In reply to Kubilay Kocak from comment #3) Success! Thanks!
Lovely, thanks for reporting back, I'll make the change now :)
A commit references this bug: Author: koobs Date: Tue Jan 27 10:47:50 UTC 2015 New revision: 377991 URL: https://svnweb.freebsd.org/changeset/ports/377991 Log: devel/libhtp, security/suricata: Use iconv:translit Use translit for USES=iconv, fixing a build error on specific (10-STABLE r???) versions of FreeBSD that dont contain a libiconv implementation with certain features [1] in base. PR: 196720 [1] Reported by: <trond.endrestol ximalas info> Changes: head/devel/libhtp/Makefile head/security/suricata/Makefile
Committed with minor (unrelated) changes, thanks Trond!