Bug #76403 [NEW]: macOS compile linking to system libs instead of local

From: Date: Sat, 02 Jun 2018 00:16:33 +0000
Subject: Bug #76403 [NEW]: macOS compile linking to system libs instead of local
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215468@lists.php.net to get a copy of this message
From:             kevin dot abel dot 0 at gmail dot com
Operating system: macOS
PHP version:      7.2.6
Package:          *Compile Issues
Bug Type:         Bug
Bug description:macOS compile linking to system libs instead of local

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 bug report at https://bugs.php.net/bug.php?id=76403&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=76403&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=76403&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=76403&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=76403&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=76403&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=76403&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=76403&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=76403&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=76403&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=76403&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=76403&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=76403&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=76403&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76403&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=76403&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=76403&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=76403&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76403&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=76403&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=76403&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#215468) next »