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: 2021-06-20 04:22 UTC
Votes:9
Avg. Score:4.4 ± 0.8
Reproduced:9 of 9 (100.0%)
Same Version:1 (11.1%)
Same OS:8 (88.9%)
From: philip@php.net Assigned: cmb (profile)
Status: No Feedback Package: Compile Failure
PHP Version: php5.3-201010251830 OS: Mac OS X
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: philip@php.net
New email:
PHP Version: OS:

 

 [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
 [2021-06-10 12:39 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-06-10 12:39 UTC] cmb@php.net
Is that still an issue with any of the actively supported PHP
versions[1]?

[1] <https://www.php.net/supported-versions.php>
 [2021-06-20 04:22 UTC] php-bugs at lists dot php dot 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 "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 18:01:28 2024 UTC