|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71343 Build system tries to link with Xcode libs and link fails
Submitted: 2016-01-12 01:11 UTC Modified: 2016-06-04 01:15 UTC
Avg. Score:4.2 ± 1.0
Reproduced:5 of 5 (100.0%)
Same Version:0 (0.0%)
Same OS:5 (100.0%)
From: Assigned:
Status: Open Package: Compile Failure
PHP Version: Irrelevant OS: OSX
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2016-01-12 01:11 UTC]
Xcode libs should have lowest precedence, but build system tries to link with Xcode libs and link fails.

It seems not only -L flag, but also -I flag (and others) have the same issue.

All supported/dev branches have this problem.

Test script:
$ YACC=/usr/local/opt/bison27/bin/bison ./configure --with-iconv=/usr/local/opt/libiconv && make -j 4

You'll need brew's bison27 and libiconv.

Expected result:
Link should succeed. 

Actual result:
cc -I/usr/local/opt/libiconv/include -g -O2 -fvisibility=hidden   -L/Applications/ -L/usr/local/opt/libiconv/lib  -Wl,-rpath,/Applications/ -Wl,-rpath,/usr/local/opt/libiconv/lib ext/date/php_date.o ext/date/lib/astro.o ext/date/lib/dow.o ext/date/lib/parse_date.o ext/date/lib/parse_tz.o 
main/fastcgi.o sapi/cgi/cgi_main.o  -lresolv -liconv -liconv -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm  -o sapi/cgi/php-cgi
Undefined symbols for architecture x86_64:
  "_libiconv", referenced from:
      _zif_iconv_substr in iconv.o
      _zif_iconv_mime_encode in iconv.o
      _php_iconv_string in iconv.o
      __php_iconv_strlen in iconv.o
      __php_iconv_strpos in iconv.o
      __php_iconv_appendl in iconv.o
      _php_iconv_stream_filter_append_bucket in iconv.o


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-06-04 01:15 UTC]
-PHP Version: 5.6Git-2016-01-12 (Git) +PHP Version: Irrelevant
 [2016-06-04 01:15 UTC]
I build PHP on OSX on occasions and I still have this issue.


before libs specified by configure options. If you have the same issue, remove OSX/Xcode system lib from EXTRA_LDFALGS/EXTRA_LDFLAGS_PROGRAMS.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed May 12 06:01:23 2021 UTC