Bug #76403 [Com]: macOS compile linking to system libs instead of local
| From: | random dot address at gmail dot com | Date: | Tue, 27 Aug 2019 18:30:54 +0000 |
| Subject: | Bug #76403 [Com]: macOS compile linking to system libs instead of local | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-222440@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76403&edit=1
ID: 76403
Comment by: random dot address at gmail dot com
Reported by: kevin dot abel dot 0 at gmail dot com
Summary: macOS compile linking to system libs instead of
local
Status: Open
Type: Bug
Package: *Compile Issues
Operating System: macOS
PHP Version: 7.2.6
Block user comment: N
Private report: N
New Comment:
This is error which real for all. Must do sumthing now. Without fix it crash and burn. we no like a
that. we mwust do it now it is the time has called.
Previous Comments:
------------------------------------------------------------------------
[2018-07-25 08:40:46] jan dot a dot viljanen at gmail dot com
To boil this down to something that's easily reproducible you can use this
./configure --disable-all --with-ldap=/usr/local/opt/openldap
make
Produces
# otool -L sapi/cli/php
sapi/cli/php:
/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/opt/openldap/lib/libldap-2.4.2.dylib (compatibility version 13.0.0, current version
13.9.0)
/usr/local/opt/openldap/lib/liblber-2.4.2.dylib (compatibility version 13.0.0, current version
13.9.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)
whereas
./configure --disable-all --with-ldap=/usr/local/opt/openldap --enable-libxml
make
produces
# otool -L sapi/cli/php
sapi/cli/php:
/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/LDAP.framework/Versions/A/LDAP (compatibility version 1.0.0, current
version 2.4.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)
/usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.9.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/usr/lib/libicucore.A.dylib (compatibility version 1.0.0, current version 59.1.0)
I'm on macOS 10.13.6 and this was tested with PHP 7.2.8 .
This is a showstopper for including some PHP extensions in the homebrew package manager project and
also why we can't use the openldap package as suggested here https://bugs.php.net/bug.php?id=76433 . OP has
updated the issue on github https://github.com/Homebrew/homebrew-core/issues/28398#issuecomment-407615789
with some more information.
------------------------------------------------------------------------
[2018-06-02 00:16:29] kevin dot abel dot 0 at gmail dot com
Description:
------------
While running configure on macOS, the system library path is getting added to the list of library
paths via the autoconf function PHP_ADD_LIBPATH. The build tools on macOS use paths like
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib"
and "/Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk/usr/lib" that the linker
knows to refer back to the more common /usr/lib.
This is causing the macOS linker to link to system libraries rather than versions explicitly
provided in configure flags.
This issue is affecting the Homebrew package manager, tracked at https://github.com/Homebrew/homebrew-core/issues/28398
Test script:
---------------
./configure
--prefix=/usr/local/Cellar/php/7.2.6
--localstatedir=/usr/local/var
--sysconfdir=/usr/local/etc/php/7.2
--with-config-file-path=/usr/local/etc/php/7.2
--with-config-file-scan-dir=/usr/local/etc/php/7.2/conf.d
--with-pear=/usr/local/Cellar/php/7.2.6/share/php/pear
--enable-bcmath
--enable-calendar
--enable-dba
--enable-dtrace
--enable-exif
--enable-ftp
--enable-fpm
--enable-intl
--enable-mbregex
--enable-mbstring
--enable-mysqlnd
--enable-opcache-file
--enable-pcntl
--enable-phpdbg
--enable-phpdbg-webhelper
--enable-shmop
--enable-soap
--enable-sockets
--enable-sysvmsg
--enable-sysvsem
--enable-sysvshm
--enable-wddx
--enable-zip
--with-apxs2=/usr/local/opt/httpd/bin/apxs
--with-bz2
--with-fpm-user=_www
--with-fpm-group=_www
--with-freetype-dir=/usr/local/opt/freetype
--with-gd
--with-gettext=/usr/local/opt/gettext
--with-gmp=/usr/local/opt/gmp
--with-icu-dir=/usr/local/opt/icu4c
--with-jpeg-dir=/usr/local/opt/jpeg
--with-kerberos
--with-layout=GNU
--with-ldap
--with-ldap-sasl
--with-libedit
--with-libzip
--with-mhash
--with-mysql-sock=/tmp/mysql.sock
--with-mysqli=mysqlnd
--with-ndbm
--with-openssl=/usr/local/opt/openssl
--with-password-argon2=/usr/local/opt/argon2
--with-pdo-dblib=/usr/local/opt/freetds
--with-pdo-mysql=mysqlnd
--with-pdo-odbc=unixODBC,/usr/local/opt/unixodbc
--with-pdo-pgsql=/usr/local/opt/libpq
--with-pgsql=/usr/local/opt/libpq
--with-pic
--with-png-dir=/usr/local/opt/libpng
--with-pspell=/usr/local/opt/aspell
--with-sodium=/usr/local/opt/libsodium
--with-unixODBC=/usr/local/opt/unixodbc
--with-webp-dir=/usr/local/opt/webp
--with-xmlrpc
--with-xsl
--with-zlib
--with-curl
Expected result:
----------------
The php binary is compiled and linked to the libpq library at
/usr/local/opt/libpq/lib/libpq.5.dylib.
The Makefile does not include references to macOS's build tool SDK directories.
Actual result:
--------------
The php binary is compiled and linked to the system libpq library at /usr/lib/libpq.5.dylib.
The Makefile includes references to
/Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk/usr/lib.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76403&edit=1