php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20484 Wrong detection of gnuiconv
Submitted: 2002-11-18 11:37 UTC Modified: 2002-12-01 16:34 UTC
Votes:5
Avg. Score:4.4 ± 0.8
Reproduced:5 of 5 (100.0%)
Same Version:1 (20.0%)
Same OS:1 (20.0%)
From: paj at pearfr dot org Assigned:
Status: No Feedback Package: ICONV related
PHP Version: 4CVS-2002-11-18 (dev) OS: Linux RH 7.3, gnu libiconv
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: paj at pearfr dot org
New email:
PHP Version: OS:

 

 [2002-11-18 11:37 UTC] paj at pearfr dot org
Hello,

I used redhat 7.3 and current cvs, iconv installed from sources using version 1.8 (no rpm previously installed).

Configure options:./configure --prefix=/usr/local \
--enable-cli \
--enable-exif \
--with-calendar=shared \
--enable-magic-quotes \
--enable-trans-sid \
--enable-wddx \
--enable-ftp \
--with-gd \
--with-zlib \
--enable-gd-native-tt \
--with-t1lib="/usr/local" \
--with-jpeg-dir="/usr" \
--with-png-dir="/usr" \
--with-zlib-dir="/usr" \
--with-ttf \
--with-freetype-dir="/usr" \
 --with-mcrypt=/usr \
 --with-unixodbc=/usr \
--with-tiff-dir="/usr" \
--with-jpeg-dir="/usr" \
--with-zlib-dir="/usr" \
--with-xmlrpc \
 --with-openssl="/usr" \
 --with-ming="/usr/local" \
 --enable-bcmath \
 --with-gettext="/usr" \
 --with-mysql=/usr \
 --with-pgsql=/usr \
 --with-ibm-db2 \
 --enable-xslt \
 --with-xslt-sablot=/usr \
 --with-sablot-js=/usr \
 --enable-sockets \
 --with-imagick=/usr/local \
 --with-dom \
 --with-dom-xslt \
 --with-dom-exslt \
 --with-java=/usr/java/jdk1.3.1_03 \
 --with-tokenizer \
 --with-iconv=/usr \
 --with-iconv-dir=/usr \


make failed on:
/home/paj/projects/phpcvsbuild/php4/ext/iconv/iconv.c: In function `zm_startup_miconv':
/home/paj/projects/phpcvsbuild/php4/ext/iconv/iconv.c:140: `_libiconv_version' undeclared (first use in this function)
/home/paj/projects/phpcvsbuild/php4/ext/iconv/iconv.c:140: (Each undeclared identifier is reported only once
/home/paj/projects/phpcvsbuild/php4/ext/iconv/iconv.c:140: for each function it appears in.)
/home/paj/projects/phpcvsbuild/php4/ext/iconv/iconv.c: In function `php_iconv_string':
/home/paj/projects/phpcvsbuild/php4/ext/iconv/iconv.c:255: warning: assignment makes pointer from integer without a cast
make: *** [ext/iconv/iconv.lo] Error 1

It seems the wrong lib are detected:
<snip>
    136 #if HAVE_LIBICONV
    137     {
    138         static char buf[16];
    139         snprintf(buf, sizeof(buf), "%d.%d",
    140             ((_libiconv_version >> 8) & 0x0f),
(_libiconv_version & 0x0f));    141         version = buf;
    142     }
    143 #elif HAVE_GLIBC_ICONV
    144     version = (char *)gnu_get_libc_version();
    145 #endif
<snip>

hth

pa

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-18 13:14 UTC] michael dot mauch at gmx dot de
Can you please try

  --with-iconv

without "=/usr" and without the "--with-iconv-dir=/usr"? Your Redhat 7.3 should have a glibc 2.2.x, which has iconv builtin, so there's AFAIK no point in installing an extra libiconv.
 [2002-11-18 13:58 UTC] moriyoshi@php.net
Michael's suggestion is really to the point.
Open => Feedback
 [2002-11-18 19:24 UTC] moriyoshi@php.net
Besides what configure params did you install libiconv with?
 [2002-11-19 09:17 UTC] paj at pearfr dot org
Hello,

Sorry for the answer delay, my home connection is down and/or too tired ;-)

Well, using only '--with-iconv' gave me the same error.

<Besides what configure params did you install libiconv with?>

./configure --prefix=/usr

I cannot remove it as far as I need it for php_dom too.

hth

pa
 [2002-11-19 09:31 UTC] paj at pearfr dot org
After a make clean, which I forgot to do before, using only '--with-iconv' I got the same error I got weeks ago during make:


ext/iconv/iconv.lo: In function `zm_startup_miconv':
/home/paj/projects/phpcvsbuild/php4/ext/iconv/iconv.c:139: undefined reference to `_libiconv_version'
ext/iconv/iconv.lo: In function `php_iconv_string':
/home/paj/projects/phpcvsbuild/php4/ext/iconv/iconv.c:217: undefined reference to `libiconv_open'
/home/paj/projects/phpcvsbuild/php4/ext/iconv/iconv.c:226: undefined reference to `libiconv'
/home/paj/projects/phpcvsbuild/php4/ext/iconv/iconv.c:238: undefined reference to `libiconv_close'
ext/xmlrpc/libxmlrpc/encodings.lo: In function `convert':
/home/paj/projects/phpcvsbuild/php4/ext/xmlrpc/libxmlrpc/encodings.c:62: undefined reference to `libiconv_open'
/home/paj/projects/phpcvsbuild/php4/ext/xmlrpc/libxmlrpc/encodings.c:73: undefined reference to `libiconv'
/home/paj/projects/phpcvsbuild/php4/ext/xmlrpc/libxmlrpc/encodings.c:93: undefined reference to `libiconv_close'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

pa
 [2002-11-19 09:52 UTC] moriyoshi@php.net
Basically it's supposed to cause unexpected results that you install libiconv with --prefix=/usr, because libiconv would overwrite /usr/include/iconv.h that comes from glibc, which offers iconv functionality independently. It should be avoided when using linux.

Anyway, could you try following commands in the top of the PHP source directory and configure again?

$ rm -f include/*

 [2002-12-01 16:34 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2012-11-02 17:06 UTC] denis_truffaut at hotmail dot com
I validate the

  --with-iconv

instead of

  --width-iconv=/usr/lib

Other posts said that you had to try to switch between both instructions, 
depending on your configuration.

This trick saved my PHP 5.4 compilation.

Thanks ! :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 14:01:29 2024 UTC