|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchespatch-ext_odbc_config_m4.diff (last revision 2017-07-05 09:48 UTC by martijn at openbsd dot org)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-06-08 14:31 UTC] spam2 at rhsoft dot net
[2017-07-05 09:52 UTC] martijn at openbsd dot org
[2021-10-06 13:39 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Package: Dynamic loading
+Package: *Compile Issues
-Assigned To:
+Assigned To: cmb
[2021-10-06 13:39 UTC] cmb@php.net
[2021-10-17 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 05:00:01 2025 UTC |
Description: ------------ When building PHP with shared modules I found that php wouldn't startup any more when removing one of the modules and dependencies of the system (in this case ext/odbc). This is because libiodbc is linked into the different SAPIs: $ ldd ./php ./php: Start End Type Open Ref GrpRef Name 00000a9e0f800000 00000a9e0ff02000 exe 2 0 0 ./php 00000aa0c76d5000 00000aa0c7927000 rlib 0 1 0 /usr/local/lib/libiodbc.so.3.16 00000aa0f976d000 00000aa0f997b000 rlib 0 4 0 /usr/lib/libpthread.so.23.0 00000aa102095000 00000aa1023ab000 rlib 0 1 0 /usr/lib/libstdc++.so.57.0 00000aa087c66000 00000aa087e8d000 rlib 0 3 0 /usr/lib/libm.so.10.0 00000aa0e1e2e000 00000aa0e2044000 rlib 0 2 0 /usr/lib/libz.so.5.0 00000aa03e983000 00000aa03ebc7000 rlib 0 1 0 /usr/local/lib/libpcre.so.3.0 00000aa06c91f000 00000aa06cc81000 rlib 0 1 0 /usr/local/lib/libxml2.so.15.2 00000aa0458a5000 00000aa045aca000 rlib 0 2 0 /usr/local/lib/liblzma.so.2.1 00000aa089fd8000 00000aa08a2d7000 rlib 0 2 0 /usr/local/lib/libiconv.so.6.0 00000aa0ec06b000 00000aa0ec2bd000 rlib 0 1 0 /usr/lib/libssl.so.43.3 00000aa0fbff1000 00000aa0fc3bb000 rlib 0 2 0 /usr/lib/libcrypto.so.41.2 00000aa0b473e000 00000aa0b4a0b000 rlib 0 1 0 /usr/lib/libc.so.89.5 00000aa085600000 00000aa085600000 rtld 0 1 0 /usr/libexec/ld.so I traced the problem via Makefile target BUILD_CLI which include EXTRA_LIBS, which has this extra library added. When looking around in the configure file I found that EXTRA_LIBS is a concatenation of $EXTRA_LIBS $DLIBS $LIBS. Adding some debugging found me that LIBS is the culprit in this case. Continuing my search I found that LIBS is used in quite a few places throughout the m4 files and that most of the time they save the value in a tempvar and restore it later, but I did find that the PHP_ADD_LIBRARY macro in aclocal.m4 and acinclude.m4 contains LIBS as the 5th argument. This in my opinion is the most likely cause for not unsetting LIBS. I tried to change the name LIBS to BLAHLIBS, but that breaks the libxml checks. Issue found in php 5.6.30, 7.0.19 and 7.1.5 Test script: --------------- ./configure --disable-rpath --disable-static --enable-inline-optimization --enable-shared --program-suffix=-7.1 --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php-7.1 --with-pear=/usr/local/share/php-7.1 --with-pic --enable-filter --enable-hash --enable-libxml=/usr/local --enable-session --with-mhash=/usr/local --with-openssl --with-pcre-regex=/usr/local --with-zlib --with-apxs2=/usr/local/sbin/apxs2 --enable-cgi --enable-cli --disable-phpdbg --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-bcmath=shared --with-bz2=shared,/usr/local --enable-calendar=shared --enable-ctype=shared --with-curl=shared,/usr/local --enable-dba=shared --with-gdbm=/usr/local --enable-dom=shared --with-enchant=shared --enable-exif=shared --enable-fileinfo=shared --enable-ftp=shared --with-gd=shared --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-zlib-dir=/usr --with-freetype-dir=/usr/X11R6 --with-xpm-dir=/usr/X11R6 --with-gettext=shared,/usr/local --with-gmp=shared,/usr/local --with-iconv=shared,/usr/local --with-imap=shared,/usr/local --with-imap-ssl --enable-intl=shared --with-icu-dir=/usr/local --enable-json=shared --with-ldap=shared,/usr/local --with-ldap-sasl=/usr/local --enable-mbstring=shared --with-onig=/usr/local --with-mcrypt=shared,/usr/local --enable-mysqlnd=shared --with-mysqli=shared,mysqlnd --with-iodbc=shared,/usr/local --enable-opcache --enable-pcntl=shared --enable-pdo=shared --with-pdo-dblib=shared,/usr/local --with-pdo-mysql=shared,mysqlnd --with-pdo-pgsql=shared,/usr/local --with-pdo-sqlite=shared,/usr/local --with-pgsql=shared,/usr/local --enable-phar=shared --enable-posix=shared --with-pspell=shared,/usr/local --with-readline=shared --enable-shmop=shared,/usr/local --enable-simplexml=shared --with-snmp=shared,/usr/local --enable-soap=shared,/usr/local --enable-sockets=shared --with-sqlite3=shared,/usr/local --enable-sysvmsg=shared --enable-sysvsem=shared --enable-sysvshm=shared --with-tidy=shared,/usr/local --enable-tokenizer=shared --enable-wddx=shared --enable-xml=shared --enable-xmlreader=shared --with-xmlrpc=shared --enable-xmlwriter=shared --with-xsl=shared --enable-zip=shared,/usr/local --prefix=/usr/local --sysconfdir=/etc --mandir=/usr/local/man --infodir=/usr/local/info --localstatedir=/var --disable-silent-rules --disable-gtk-doc CFLAGS=-O2 -pipe -I/usr/local/include -pthread YACC=/usr/bin/yacc make ldd sapi/cli/php