php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77011 configure cannot detect iconv library on Mojave (macOS 10.14)
Submitted: 2018-10-14 19:42 UTC Modified: 2019-04-20 16:45 UTC
Votes:4
Avg. Score:3.8 ± 0.8
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:2 (100.0%)
From: axnnoindexr11 at gmail dot com Assigned:
Status: Re-Opened Package: Compile Failure
PHP Version: 7.3.0RC3 OS: macOS 10.14
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-10-14 19:42 UTC] axnnoindexr11 at gmail dot com
Description:
------------
In Mojave, remove /usr/include and put system headers on only /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include: https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes#3035624

Yesterday, I tried to compile PHP with iconv bundled Mojave, but ./configure reports an error: Please reinstall the iconv library.
I researched the reason and I found that shared libraries bundled Mojave have strange extensions, `.tbd`.

```
$ xcrun --show-sdk-path
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk
$ ls $(xcrun --show-sdk-path)/usr/include/iconv.h
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/iconv.h
$ ls $(xcrun --show-sdk-path)/usr/lib/libiconv.*
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libiconv.2.4.0.tbd
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libiconv.2.tbd
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libiconv.tbd
$ ls /usr/include
ls: cannot access '/usr/include': No such file or directory
$ ls /usr/lib/libiconv.*
/usr/lib/libiconv.2.4.0.dylib
/usr/lib/libiconv.2.dylib
/usr/lib/libiconv.dylib
```

configure of PHP check only `.dylib` for macOS libraries.  Actually, `.tbd` is also a shared library extension for macOS and make works well after I applied simple patch that also checks `.tbd`.

I want to add `.tbd` extension support for configure.


Test script:
---------------
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update && brew install autoconf pkg-config bison sqlite
./buildconf
env PATH=$(brew --prefix bison)/bin:$PATH ./configure \
  --without-pear \
  --enable-fpm \
  --with-mysqli \
  --with-sqlite3=$(brew --prefix sqlite) \
  --with-pdo-sqlite=$(brew --prefix sqlite) \
  --with-iconv=$(xcrun --show-sdk-path)/usr


Expected result:
----------------
No errors

Actual result:
--------------
...
checking size of short... (cached) 2
checking size of int... (cached) 4
checking size of long... (cached) 8
checking size of long long... (cached) 8
checking size of long int... 8
checking checking if we're at 64-bit platform... yes
checking for iconv support... yes
configure: error: Please reinstall the iconv library.

Patches

add-tbd-ext-for-iconv (last revision 2018-10-14 19:42 UTC by )

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-04-09 00:53 UTC]
The following pull request has been associated:

Patch Name: Fix #77011: configure cannot detect iconv library on Mojave (macOS 10.14)
On GitHub:  https://github.com/php/php-src/pull/4016
Patch:      https://github.com/php/php-src/pull/4016.patch
 [2019-04-20 13:22 UTC] petk@php.net
Automatic comment on behalf of gabriel.couto@memed.com.br
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e28db2276b3d73bcdbf256bd7efffff3e8f874e0
Log: Fixed bug #77011
 [2019-04-20 13:22 UTC] petk@php.net
-Status: Open +Status: Closed
 [2019-04-20 13:24 UTC] petk@php.net
-Status: Closed +Status: Re-Opened
 [2019-04-20 13:24 UTC] petk@php.net
Reopening since the fix was only a quickfix for now to be able to test PHP-7.4 and master branches on macos systems. More proper fix is also coming up for PHP-7.2 and above for latest macos systems thanks to https://github.com/php/php-src/pull/3616
 [2019-04-20 13:25 UTC] petk@php.net
The following pull request has been associated:

Patch Name: Support shared libraries of macOS SDKs
On GitHub:  https://github.com/php/php-src/pull/3616
Patch:      https://github.com/php/php-src/pull/3616.patch
 [2019-04-20 16:45 UTC] nikic@php.net
@petk: I don't believe we plan to apply that PR. We should only add handling for this in places which have not already been fixed by pkg-config migration.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 05:01:29 2024 UTC