Bug 181515

Summary: WITH_ICONV breaks devel/gettext 0.18.3
Product: Ports & Packages Reporter: Shane <FreeBSD>
Component: Individual Port(s)Assignee: autotools
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Shane 2013-08-25 06:30:00 UTC
If buildworld is compiled with WITH_ICONV=yes in src.conf then gettext-0.18.3 fails to run. The port compiles ok but when the binaries are run they fail. At least msgfmt fails.

The previous version - gettext-0.18.1.1_1 - didn't exhibit this issue.

The same issue is present with 9.1-RELEASE-p5 and 9.2-RC3 (I don't believe 8.x has the WITH_ICONV option)

I have tested this within tinderbox. I can build a releng/9.2 jail (9.2-RC3 r254795), build gettext and it can be used. Then put WITH_ICONV=yes in the jails src.conf and re-make jail, re-build gettext and it will fail.

I have used two tinderbox builds to test (both amd64), one using CC=gcc CC=g++ CPP=cpp in the tinderbox build environment the other CC=clang CXX=clang++ CPP=clang-cpp and I get the same results with both.

A gettext binary built in a world compiled without WITH_ICONV runs fine in a world with WITH_ICONV, it needs to be compiled within a world that has WITH_ICONV to fail.

A quick test example is misc/getopt - it fails to build with msgfmt giving an invalid multibyte sequence error. Part of the logfile --

===>  Building for getopt-1.1.5
gcc -c  -DLIBCGETOPT=1 -DWITHOUT_GETTEXT=0 -DLOCALEDIR=\"/usr/local/share/locale\" -DNOT_UTIL_LINUX -Dprogram_invocation_short_name=\"getopt\"  -Dprogram_version=\"1.1.5\" -O2 -pipe -I/usr/local/include -fno-strict-aliasing getopt.c -o getopt.o
msgfmt -o po/ca.mo po/ca.po
msgfmt -o po/cs.mo po/cs.po
msgfmt -o po/da.mo po/da.po
po/da.po:66:7: invalid multibyte sequence
po/da.po:66:8: invalid multibyte sequence
po/da.po:66:18: invalid multibyte sequence
po/da.po:66:19: invalid multibyte sequence

How-To-Repeat: steps taken to re-produce this issue using tinderbox -
build a test jail based on releng/9.2
create a build using the new 9.2 jail
use that build to compile devel/gettext
test gettext by compiling misc/getopt - works at this point
add WITH_ICONV=yes to ${pd}/jails/${TESTJAILNAME}/src.conf
re-make the test jail
re-compile devel/gettext
re-compile misc/getopt - now fails
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2013-08-26 00:43:19 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-ports-bugs

Fix synopsis and assign.
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2013-08-26 00:44:11 UTC
Responsible Changed
From-To: freebsd-ports-bugs->autotools

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 3 Ade Lovett freebsd_committer freebsd_triage 2013-08-26 17:32:49 UTC
State Changed
From-To: open->closed

This is a fault with the iconv-in-libc.  It was fixed in HEAD with 
svn r254080 - a cursory inspection indicates that this was not MFC'd 
and with 9.2-R in full swing, is unlikely to be now.