Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 13705 - emerge of gal 0.22 fails because of limited iconv in glibc 2.3.1 r3
Summary: emerge of gal 0.22 fails because of limited iconv in glibc 2.3.1 r3
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
: 13891 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-01-11 04:33 UTC by Frantz Dhin
Modified: 2003-02-04 19:42 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frantz Dhin 2003-01-11 04:33:31 UTC
Tried an emerge of latest gal. It failed during configure with the following error:

checking for iconv in -liconv... no
checking for iconv... yes
checking for gnu_get_libc_version... yes
checking if iconv() handles UTF-8... no
configure: error: You need to install a working iconv implementation, such as
ftp://ftp.gnu.org/pub/gnu/libiconv

!!! ERROR: gnome-extra/gal-0.22 failed.
!!! Function src_compile, Line 39, Exitcode 1
!!! (no error message)

The libiconv package is currently masked and according to description it can
"break things". Iconv on my system came from glibc-2.3.1-r3
Comment 1 Rigo 2003-01-11 08:55:59 UTC
Since package.mask tells me libiconv breaks evolution (but gal-0.22 is it's
dependency) I went ahead and used libiconv-1.8 (new code on the site). 

Besides having some trouble during the install (it wants to build against the
lib, who is in '/var/tmp/portage/libi.../image' instead)...To tackle this I ran
a manual 'make install' first, so it would be there the next run ;-)...Not the
most beautiful way, but now gal-0.22 compiles fine for me (using libiconv, not
without it.).

Regards, Rogi
Comment 2 foser (RETIRED) gentoo-dev 2003-01-12 12:22:26 UTC
can you give me the config.log of the failing configure step ?
Comment 3 Rigo 2003-01-13 02:57:30 UTC
configure:10998: gcc -o conftest -march=pentium3 -O3 -pipe -Wall -Wunused    -
I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -
I/usr/X11R6/include  conftest.c   -liconv >&5
configure:10983:19: iconv.h: No such file or directory
configure: In function `main':
configure:10989: `iconv_t' undeclared (first use in this function)
configure:10989: (Each undeclared identifier is reported only once
configure:10989: for each function it appears in.)
configure:10989: parse error before "cd"
configure:10990: `cd' undeclared (first use in this function)
configure:10990: warning: implicit declaration of function `iconv_open'
configure:11001: $? = 1
configure: failed program was:
#line 10981 "configure"
#include "confdefs.h"

#include <iconv.h>

int
main ()
{

	iconv_t cd;
	cd = iconv_open ("UTF-8", "ISO-8859-1");

  ;
  return 0;
}
configure:11017: result: no
configure:11025: checking for iconv
configure:11062: gcc -o conftest -march=pentium3 -O3 -pipe -Wall -Wunused   -
I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -
I/usr/X11R6/include  conftest.c  >&5
configure:11065: $? = 0
configure:11068: test -s conftest
configure:11071: $? = 0
configure:11081: result: yes
configure:11097: checking for gnu_get_libc_version
configure:11134: gcc -o conftest -march=pentium3 -O3 -pipe -Wall -Wunused   -
I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -
I/usr/X11R6/include  conftest.c  >&5
configure:11137: $? = 0
configure:11140: test -s conftest
configure:11143: $? = 0
configure:11153: result: yes
configure:11164: checking if iconv() handles UTF-8
configure:11210: gcc -o conftest -march=pentium3 -O3 -pipe -Wall -Wunused   -
I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -
I/usr/X11R6/include  conftest.c  >&5
configure:11175:19: iconv.h: No such file or directory
configure: In function `main':
configure:11187: `iconv_t' undeclared (first use in this function)
configure:11187: (Each undeclared identifier is reported only once
configure:11187: for each function it appears in.)
configure:11187: parse error before "cd"
configure:11197: `cd' undeclared (first use in this function)
configure:11197: warning: implicit declaration of function `iconv_open'
configure:11200: warning: implicit declaration of function `iconv'
configure:11213: $? = 1
configure: program exited with status 1
configure: failed program was:
#line 11173 "configure"
#include "confdefs.h"

#include <iconv.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_GNU_GET_LIBC_VERSION
#include <gnu/libc-version.h>
#endif

int main (int argc, char **argv)
{
	const char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C";
	const char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E";
	char *transbuf = malloc (10), *trans = transbuf;
	iconv_t cd;
	size_t jp_len = strlen (jp), utf8_len = 10;
	size_t utf8_real_len = strlen (utf8);

#ifdef HAVE_GNU_GET_LIBC_VERSION
	/* glibc 2.1.2's iconv is broken in hard to test ways. */
	if (!strcmp (gnu_get_libc_version (), "2.1.2"))
		exit (1);
#endif

	cd = iconv_open ("UTF-8", "ISO-2022-JP");
	if (cd == (iconv_t) -1)
		exit (1);
	if (iconv (cd, &jp, &jp_len, &trans, &utf8_len) == -1 || jp_len != 0)
		exit (1);
	if (memcmp (utf8, transbuf, utf8_real_len) != 0)
		exit (1);

	exit (0);
}
configure:11230: result: no
configure:11235: error: You need to install a working iconv implementation, 
such as ftp://ftp.gnu.org/pub/gnu/libiconv
Comment 4 Rigo 2003-01-13 03:07:37 UTC
<SNIP>
# According to spider this breaks gnome-vfs (sandymac, 03 May 2002):
# and evolution (azarah, 05 May 2002)
#dev-libs/libiconv
</SNIP>

Additionally (Saw the remarks where > 6mnd. ago) I tried emerging evolution-
1.2.1 WITH libiconv (1.8) installed, and I can confirm it compiles(3.2.1)/works 
for sending/receiving mail (only functionality tested)...


Regards, Rogi
Comment 5 foser (RETIRED) gentoo-dev 2003-01-13 07:08:04 UTC
We know it works, but it just aint very smart to use.

Anyway the problem is, there is no iconv.h on your system and glibc should
always install this, can you check if /usr/include/iconv.h exists ? If it
doesnt, can you rebuild glibc see if it turns up ?
Comment 6 Rigo 2003-01-13 12:49:47 UTC
Oh sorry, didn't know that...

<SNIP>
>>> sys-libs/glibc-2.3.1-r3 merged.

 sys-libs/glibc
    selected: none
   protected: 2.3.1-r3
     omitted: none

>>> clean: No packages selected for removal.

>>> Regenerating /etc/ld.so.cache...
>>> Auto-cleaning packages ...

>>> No outdated packages were found on your system.

# ls -la /usr/include/iconv.h
-rw-r--r--    1 root     root     1776 Jan 13 20:37 /usr/include/iconv.h
</SNIP>

Even supplying configure the option --with-libiconv=/usr

<SNIP>
checking for iconv in -liconv... no
checking for iconv... yes
checking for gnu_get_libc_version... yes
checking if iconv() handles UTF-8... no
configure: error: You need to install a working iconv implementation, such as 
ftp://ftp.gnu.org/pub/gnu/libiconv
</SNIP>

Rereading config.log, and it looks like something changed:

<SNIP>
configure:11164: checking if iconv() handles UTF-8
configure:11210: gcc -o conftest -march=pentium3 -O3 -pipe -Wall -Wunused   -
I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -
I/usr/X11R6/include  conftest.c  >&5
configure: In function `main':
configure:11200: warning: passing arg 2 of `iconv' from incompatible pointer 
type
configure:11213: $? = 0
configure:11215: ./conftest
configure:11218: $? = 1
configure: program exited with status 1
configure: failed program was:
#line 11173 "configure"
#include "confdefs.h"

#include <iconv.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_GNU_GET_LIBC_VERSION
#include <gnu/libc-version.h>
#endif
</SNIP>

Looks like now it can find it, but still a no-go :-(
Comment 7 foser (RETIRED) gentoo-dev 2003-01-13 13:27:19 UTC
if you compile this (conftest.c) :

#include <iconv.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_GNU_GET_LIBC_VERSION
#include <gnu/libc-version.h>
#endif
 
int main (int argc, char **argv)
{
        const char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C";
        const char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E";
        char *transbuf = malloc (10), *trans = transbuf;
        iconv_t cd;
        size_t jp_len = strlen (jp), utf8_len = 10;
        size_t utf8_real_len = strlen (utf8);
 
#ifdef HAVE_GNU_GET_LIBC_VERSION
        /* glibc 2.1.2's iconv is broken in hard to test ways. */
        if (!strcmp (gnu_get_libc_version (), "2.1.2"))
                exit (1);
#endif
 
        cd = iconv_open ("UTF-8", "ISO-2022-JP");
        if (cd == (iconv_t) -1)
                exit (1);
        if (iconv (cd, &jp, &jp_len, &trans, &utf8_len) == -1 || jp_len != 0)
                exit (1);
        if (memcmp (utf8, transbuf, utf8_real_len) != 0)
                exit (1);
 
        exit (0);
}

compile like : gcc  -o conftest conftest.c, does it exit normally ? (you can
check in gdb)
Comment 8 Rigo 2003-01-14 10:38:48 UTC
Same warning during compile:

gcc  -o conftest conftest.c
conftest.c: In function `main':
conftest.c:26: warning: passing arg 2 of `iconv' from incompatible pointer type

gdb:

(gdb) run conftest
Starting program: /home/lemar/conftest conftest

Program exited with code 01.


:-(
Comment 9 foser (RETIRED) gentoo-dev 2003-01-14 11:55:37 UTC
It works for me just fine, anything special about your glibc you can think of ?
Can you try and reemerge it see if the problem stays ?
Comment 10 Rigo 2003-01-14 13:25:41 UTC
You've missed a snip ;-):

<SNIP>
>>> sys-libs/glibc-2.3.1-r3 merged.

 sys-libs/glibc
    selected: none
   protected: 2.3.1-r3
     omitted: none

>>> clean: No packages selected for removal.

>>> Regenerating /etc/ld.so.cache...
>>> Auto-cleaning packages ...

>>> No outdated packages were found on your system.

# ls -la /usr/include/iconv.h
-rw-r--r--    1 root     root     1776 Jan 13 20:37 /usr/include/iconv.h
</SNIP>

(I had to recreate the right iconv.h to try (went ahead with libiconv, but after
your remarks decided it's wiser not to)..

Actually this is not my bug, so I guess I'm not alone in this (Frantz back me up
here, please ;-), just got the same problem...It's my 2nd. Gentoo install, to
keep in sync with 'Vanilla-Gentoo' rc1/2, not changed by any strange 'gimme,
gimme new code' ebuild-behavior ;-)
Comment 11 foser (RETIRED) gentoo-dev 2003-01-14 13:29:25 UTC
can you try to debug it, figure out where it goes wrong ? it just doesnt make
much sense that it does work for me.
Comment 12 Frantz Dhin 2003-01-14 14:07:19 UTC
/usr/include/iconv.h exists on my system.
The only thing out of the ordinary that I can think of regarding my glibc is 
the following: The 2.4.20 kernel headers do not exist as a gentoo package yet. 
I extracted them from kernel source myself and had glibc compile against those. 
Second thing is that I compile with a -march=i486 flag where the actual cpu is 
a pIII. I have a good reason to do this but discussing here why would be too 
lenghty. Else, my install is pretty normal. I did not manually edit any of the 
ebuilds and the system is up to date.
I'll try reemerging glibc with -mcpu=486 flag overnight instead to make sure 
it's compatible. Will let you know in the morning, but I doubt it will make any 
difference. We'll see.
Comment 13 Frantz Dhin 2003-01-14 21:36:29 UTC
No it did not make any difference. The result remains the same.
Comment 14 Gábor Farkas 2003-01-15 06:51:27 UTC
hi. i have the same problem... 
 
conftest.c exits with code 01. 
 
the part that exits is: 
--------------------------------- 
        if (cd == (iconv_t) -1) 
                exit (1); 
--------------------------------- 
 
btw. there's an easier way to reproduce it. 
create a simple english text file, and invoke: 
 
"iconv -f UTF-8 -t ISO-2022-JP simple.txt" 
 
i get: 
iconv: conversion to `ISO-2022-JP' is not supported 
 
so i think the problem lies here. 
 
btw. i have the same configuration as rigo-k ( daily updated gentoo, 
accept-keywords="~86" 
Comment 15 foser (RETIRED) gentoo-dev 2003-01-15 07:30:00 UTC
Azarah looks like a problem specific to the last glibc revision. Any idea ?
Comment 16 Spider (RETIRED) gentoo-dev 2003-01-15 10:00:15 UTC
okay, some updates here:
gentoo 1.4 profile, ~x86 
never had libiconv installed.

---
spider@Darkmere> cat simple.txt
hello world

spider@Darkmere> iconv -f UTF-8 -t ISO-2022-JP simple.txt
hello world

spider@Darkmere>
---

bash-2.05b# emerge info
Portage 2.0.46-r6 (default-x86-1.4, gcc-3.2.1, glibc-2.3.1-r3)
=================================================================
System uname: 2.4.20-ck2 i686 AMD Athlon(tm) Processor
GENTOO_MIRRORS="http://www.ibiblio.org/pub/Linux/distributions/gentoo"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share
/config /usr/kde/3.1/share/config /usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
PORTDIR="/usr/portage"
DISTDIR="/mnt/build/distfiles"
PKGDIR="/mnt/build/packages"
PORTAGE_TMPDIR="/mnt/build"
PORTDIR_OVERLAY="/usr/local/portage"
USE="x86 apm avi encode gif jpeg libg++ mikmod mmx mpeg ncurses nls pdflib png q
tmt quicktime spell truetype xml2 xv zlib gdbm berkdb slang readline tetex aalib
 svga ggi tcltk java guile X sdl gpm tcpd pam libwww perl python esd imlib gtk m
otif opengl mozilla gphoto2 cdr crypt alsa oggvorbis -arts -qt -kde -cups gnome 
gpg gpgme bonobo doc oss ssl xmms 3dnow"
COMPILER="gcc3"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-tbird -O2 -pipe"
CXXFLAGS="-march=athlon-tbird -O2 -pipe"
ACCEPT_KEYWORDS="x86 ~x86"
MAKEOPTS="-j4  -l5"
AUTOCLEAN="yes"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
FEATURES="digest sandbox prelink ccache"


Darkmere root # locale
LANG=en_GB
LC_CTYPE="en_GB"
LC_NUMERIC="en_GB"
LC_TIME="en_GB"
LC_COLLATE="en_GB"
LC_MONETARY="en_GB"
LC_MESSAGES="en_GB"
LC_PAPER="en_GB"
LC_NAME="en_GB"
LC_ADDRESS="en_GB"
LC_TELEPHONE="en_GB"
LC_MEASUREMENT="en_GB"
LC_IDENTIFICATION="en_GB"
LC_ALL=
Comment 17 Gábor Farkas 2003-01-15 14:57:09 UTC
~x86, had once libiconv, but i removed it and recompiled half the world ( glibc,
gcc, etc ) after that

iconv -f utf-8 -t iso-2022-jp doesn't work as i've written in my comment above:

emerge info:
Portage 2.0.46-r7 (default-x86-1.4, gcc-3.2.1, glibc-2.3.1-r3)
=================================================================
System uname: 2.4.20-gentoo-r1 i686 AMD Athlon(tm) Processor
GENTOO_MIRRORS="http://mirrors.sunsite.dk/gentoo"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config
/usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config
/usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/home/portage-tmp"
PORTDIR_OVERLAY=""
USE="x86 oss 3dnow apm avi crypt cups encode gif jpeg kde libg++ libwww mikmod
mmx mpeg ncurses nls pdflib png qtmt quicktime spell truetype xml2 xmms xv zlib
gdbm berkdb slang readline arts tcltk X sdl gpm tcpd pam ssl perl python esd
imlib oggvorbis qt opengl mozilla -gnome -gtk gtk2 -java -motif -svga"
COMPILER="gcc3"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-tbird -mcpu=athlon-tbird -O3 -pipe"
CXXFLAGS="-march=athlon-tbird -mcpu=athlon-tbird -O3 -pipe"
ACCEPT_KEYWORDS="x86 ~x86"
MAKEOPTS="-j2"
AUTOCLEAN="yes"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
FEATURES="sandbox ccache"


locale:
LANG=POSIX
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

so what's the difference between my gentoo and spiders?
Comment 18 Martin Schlemmer (RETIRED) gentoo-dev 2003-01-15 16:34:05 UTC
Try the latest -r2 please.
Comment 19 Gábor Farkas 2003-01-15 19:05:56 UTC
> Try the latest -r2 please.

you mean glibc-2.3.1-r2? 

i emerged it, but still:
iconv: conversion to `ISO-2022-JP' is not supported

:(

Comment 20 Spundun Bhatt 2003-01-16 19:30:22 UTC
I am having the same problem. (I posted a question regarding that on the
gentoo-userlist today)
The irritating thing (because its NOT MAKING SENSE AT ALL) is that I already
have the latest gal installed without libiconv. (Only guess I can come up with
from your discussion below(sorry above) is that I updated glibc after my last
install of gal and now it wont build any more) 
The problem is because I need to re-emerge the same version and now its breaking
in the build process.
Letme know if you need other info.
Spundun
spundun (at) isi (dot) edu 
Comment 21 Gábor Farkas 2003-01-16 19:40:54 UTC
i reinstalled my gentoo from the 1.4rc2 live-cd 
 
and now iconf -f utf-8 -t iso-2022-jp works! 
i used an athlon-stage2 tarball => i got glibc2.3.1-rc2. 
now i emerged glibc2.3.1-rc3, and iconv-jp still works! 
 
now i don't know what to think.. 
maybe installing libiconv breaks iconv so badly that not even unmerging 
libiconv and re-emerging glibc helps? 
 
could anyone who has a working iconv-jp try to install libiconv then uninstall 
it and try whether iconv-jp still works? 
Comment 22 Spider (RETIRED) gentoo-dev 2003-01-16 19:55:39 UTC
I checked the output from the qpkg -c glibc -v -v -nc  from spandan, and the
whole setup was flawless, no modified or changed file in the glibc.


that would mean that the problem is not with how the libiconv works or not,  but
in some other component...


okay, this is -odd-

unable to reproduce it here either :/
Comment 23 Martin Schlemmer (RETIRED) gentoo-dev 2003-01-19 17:32:37 UTC
Well, it should be fixed (added patch).  If not, you had dev-libs/iconv
installed, or possibly some other weirdness.

I had this specifically with CVS snapshots of glibc-2.3.2.  This was caused by
the two 'lib*' components in /usr/lib/gconv/ not loading.  I had to add
/usr/lib/gconv to /etc/ld.so.conf for it to work :/
Comment 24 foser (RETIRED) gentoo-dev 2003-01-31 12:56:38 UTC
*** Bug 13891 has been marked as a duplicate of this bug. ***