php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53161 iconv + openssl + mac = make fail
Submitted: 2010-10-26 00:02 UTC Modified: 2010-10-26 00:09 UTC
Votes:8
Avg. Score:4.5 ± 0.9
Reproduced:8 of 8 (100.0%)
Same Version:1 (12.5%)
Same OS:7 (87.5%)
From: philip@php.net Assigned:
Status: Open Package: Compile Failure
PHP Version: php5.3-201010251830 OS: Mac OS X
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-10-26 00:02 UTC] philip@php.net
Description:
------------
Building with iconv on Mac has been an issue for years. Several bug reports 
elude to this problem, or morphed into it, but the problem still exists today. 
Probably different, but it's still here.

This may only be a symptom of a larger problem, but I've finally concluded that 
building with iconv support is incompatible with --with-openssl on Mac. Here are 
my configure/make tests:

------------------------
Configure #1 (no iconv)
------------------------
./configure --disable-all
------------------------
Make #1 (success)
------------------------
...

------------------------
Configure #2 (includes iconv)
------------------------
./configure --with-libxml-dir=/Users/philip/devel/libxml-274/
------------------------
Make #2 (success)
------------------------
...

------------------------
Configure #3 (includes iconv)
------------------------
./configure --with-libxml-dir=/Users/philip/devel/libxml-274/ --with-openssl

------------------------
Make #3 (fail)
------------------------
gi/fastcgi.o main/internal_functions.o  -lresolv -liconv -lm -lxml2 -lz -liconv 
-lm -lssl -lcrypto -lz -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lxml2 -lz 
-liconv -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm  -o sapi/cgi/php-cgi
Undefined symbols:
  "_iconv_close", referenced from:
      __php_iconv_strlen in iconv.o
      _php_iconv_string in iconv.o
      _php_iconv_string in iconv.o
      __php_iconv_strpos in iconv.o
      __php_iconv_mime_decode in iconv.o
      __php_iconv_mime_decode in iconv.o
      __php_iconv_mime_decode in iconv.o
      _zif_iconv_substr in iconv.o
      _zif_iconv_substr in iconv.o
      _php_iconv_stream_filter_dtor in iconv.o
      _zif_iconv_mime_encode in iconv.o
      _zif_iconv_mime_encode in iconv.o
  "_iconv", referenced from:
      __php_iconv_strlen in iconv.o
      _php_iconv_string in iconv.o
      _php_iconv_string in iconv.o
      __php_iconv_strpos in iconv.o
      __php_iconv_appendl in iconv.o
      __php_iconv_appendl in iconv.o
      _zif_iconv_substr in iconv.o
      _zif_iconv_mime_encode in iconv.o
      _zif_iconv_mime_encode in iconv.o
      _zif_iconv_mime_encode in iconv.o
      _zif_iconv_mime_encode in iconv.o
      _zif_iconv_mime_encode in iconv.o
      _zif_iconv_mime_encode in iconv.o
      _php_iconv_stream_filter_append_bucket in iconv.o
      _php_iconv_stream_filter_append_bucket in iconv.o
      _php_iconv_stream_filter_append_bucket in iconv.o
     (maybe you meant: _iconv_functions, _zif_iconv_mime_decode , 
_zif_iconv_substr , _zif_iconv_strlen , _zif_iconv_strpos , 
_zif_ob_iconv_handler , _iconv_module_entry , _iconv_globals , 
_zif_iconv_mime_encode , _zif_iconv_get_encoding , _php_iconv_string , 
_zif_iconv_mime_decode_headers , cstring=ob_iconv_handler , _php_if_iconv , 
_zif_iconv_set_encoding , _zif_iconv_strrpos )
  "_iconv_open", referenced from:
      __php_iconv_strlen in iconv.o
      _php_iconv_string in iconv.o
      __php_iconv_strpos in iconv.o
      __php_iconv_mime_decode in iconv.o
      __php_iconv_mime_decode in iconv.o
      _zif_iconv_substr in iconv.o
      _zif_iconv_substr in iconv.o
      _zif_iconv_mime_encode in iconv.o
      _zif_iconv_mime_encode in iconv.o
      _php_iconv_stream_filter_factory_create in iconv.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php-cgi] Error 1

------------------------
Configure #4 (includes iconv)
------------------------
./configure --disable-all --with-openssl --with-iconv

------------------------
Make #4 (fail)
------------------------
Zend/zend_execute.o sapi/cgi/cgi_main.o sapi/cgi/fastcgi.o 
main/internal_functions.o  -lresolv -liconv -liconv -lm -lssl -lcrypto -lz  -o 
sapi/cgi/php-cgi
Undefined symbols:
  "_iconv_close", referenced from:
      __php_iconv_strlen in iconv.o
      _php_iconv_string in iconv.o
      _php_iconv_string in iconv.o
      __php_iconv_strpos in iconv.o
      __php_iconv_mime_decode in iconv.o
      __php_iconv_mime_decode in iconv.o
      __php_iconv_mime_decode in iconv.o
      _zif_iconv_substr in iconv.o
      _zif_iconv_substr in iconv.o
      _php_iconv_stream_filter_dtor in iconv.o
      _zif_iconv_mime_encode in iconv.o
      _zif_iconv_mime_encode in iconv.o
  "_iconv_open", referenced from:
      __php_iconv_strlen in iconv.o
      _php_iconv_string in iconv.o
      __php_iconv_strpos in iconv.o
      __php_iconv_mime_decode in iconv.o
      __php_iconv_mime_decode in iconv.o
      _zif_iconv_substr in iconv.o
      _zif_iconv_substr in iconv.o
      _zif_iconv_mime_encode in iconv.o
      _zif_iconv_mime_encode in iconv.o
      _php_iconv_stream_filter_factory_create in iconv.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php-cgi] Error 1

------------------------
Notes:
------------------------
The following allow the configure line above to work:

(A) Removing iconv:
Obviously, using --without-iconv allows it to compile (therefore, no iconv 
errors)

(B) Building with iconv, and many options, but without OpenSSL:
Works.

(C) Same as (B) but with OpenSSL:
Fails.

(D) Building with or without the defaults, but including iconv and adding 
OpenSSL:
Fails.
------------------------

Also, many "fixes" exist all over the Internet about this problem, but elude to 
past PHP and Mac versions, ext/iconv patches, Makefile edits, and the like. This 
is a real problem.

I'm using iconv that comes with the Mac:

philip@water ~/php/src/try_10> iconv --version
iconv (GNU libiconv 1.11)

Similar (but different) bugs: bug #43189 - bug #48195 - bug #49267



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-10-26 00:09 UTC] philip@php.net
-PHP Version: 5.3.3 +PHP Version: php5.3-201010251830
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Aug 18 09:01:27 2019 UTC