php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38451 PDO_MYSQL breaks compilation
Submitted: 2006-08-14 14:01 UTC Modified: 2006-08-15 00:08 UTC
From: terry dot cullen at uq dot edu dot au Assigned: tony2001 (profile)
Status: Closed Package: PDO related
PHP Version: 5.1.4 OS: Solaris 10 x86
Private report: No CVE-ID: None
 [2006-08-14 14:01 UTC] terry dot cullen at uq dot edu dot au
Description:
------------
When compiling PHP5.1.4 on Solaris 10x86 the compilation fails with the follow error;
gcc: ext/pdo_mysql/.libs/pdo_mysql.o: No such file or directory
gcc: ext/pdo_mysql/.libs/mysql_driver.o: No such file or directory
gcc: ext/pdo_mysql/.libs/mysql_statement.o: No such file or directory
gmake: *** [ext/pdo_mysql/pdo_mysql.la] Error 1

This also happened with downloading PDO_MYSQL 1.0.2 and compiling from source.  PDO_OCI builds fine as does the rest of php when I omit the PDO_MYSQL configure line.

bash-3.00# gcc -v
Using built-in specs.
Target: i386-pc-solaris2.10
Configured with: ../gcc-4.1.0/configure --prefix=/opt/local/gcc --with-gnu-as --with-as=/usr/sfw/i386-sun-solaris2.10/bin/as --with-gnu-ld --with-ld=/usr/sfw/i386-sun-solaris2.10/bin/ld --enable-shared --enable-languages=c,c++
Thread model: posix
gcc version 4.1.0

bash-3.00# mysql -V
mysql  Ver 14.12 Distrib 5.0.19, for pc-solaris2.10 (i386) using readline 5.0


Reproduce code:
---------------
PATH='/opt/local/gcc/bin:/opt/local/php5/bin:/opt/local/perl/bin:/opt/local/mysql/mysql/bin:/usr/bin:/usr/sbin:/usr/ccs/bin:/usr/local/bin:/usr/bin/nsr:/usr/sbin/nsr:/usr/openwin/bin:/opt/csw/bin:/usr/sfw/bin:/usr/bin'
CFLAGS='-O3 -fPIC -L/opt/csw/lib' \
CPPFLAGS='-I/opt/csw/include -I/usr/include' \
LDFLAGS='-Wl,-rpath-link=/lib:/usr/lib:/opt/csw/lib:/opt/local/mysql/mysql/lib:/opt/local/mysql/mysql:/usr/sfw/lib:/opt/local/oracle/10103_client:/opt/local/oracle/10103_client/lib'

export CFLAGS CPPFLAGS LDFLAGS PATH

cd /opt/local/src/Web/PHP5/php-5.1.4/

'./configure' \
'--prefix=/opt/local/php5' \
'--with-apxs2=/opt/local/apache/bin/apxs' \
'--enable-safe-mode' \
'--with-exec-dir=/opt/local/php5/bin' \
'--enable-bcmath' \
'--enable-gd-native-ttf' \
'--enable-soap' \
'--enable-sockets' \
'--disable-rpath' \
'--enable-ftp' \
'--with-gd' \
'--with-gettext' \
'--with-imap=/src/Web/IMap/imap-2004g' \
'--with-imap-ssl=/src/Web/IMap/imap-2004g' \
'--with-jpeg-dir=/usr/lib/amd64/' \
'--with-ldap=/usr' \
'--with-mcrypt=/opt/local' \
'--with-png-dir=/usr/lib/amd64/' \
'--with-pspell=/usr' \
'--with-openssl=/opt/csw' \
'--with-zlib' \
'--with-libxml-dir=/opt/csw' \
'--with-mysql=/opt/local/mysql/mysql' \
'--with-oci8=/opt/local/oracle/10103_client' \
'--with-xpm-dir=/usr/lib' \
'--enable-memory-limit' \
'--with-gdbm=/opt/csw' \
'--with-db4=/opt/csw/bdb4' \
'--with-mhash=/opt/local/mhash' \
'--with-curl=/opt/local/curl' \
'--with-pear=/opt/local/php5' \
'--enable-pdo=shared' \
'--with-pdo-sqlite=shared' \
'--with-sqlite=shared' \
'--with-mbstring' \
'--with-mysqli=/opt/local/mysql/mysql/bin/mysql_config' \


Expected result:
----------------
Finished compilation.

Actual result:
--------------
When compiling PHP5.1.4 on Solaris 10x86 the compilation fails with the follow error;
gcc: ext/pdo_mysql/.libs/pdo_mysql.o: No such file or directory
gcc: ext/pdo_mysql/.libs/mysql_driver.o: No such file or directory
gcc: ext/pdo_mysql/.libs/mysql_statement.o: No such file or directory
gmake: *** [ext/pdo_mysql/pdo_mysql.la] Error 1


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-14 14:09 UTC] tony2001@php.net
Which ld version did you use?
`ld -v`
 [2006-08-14 14:23 UTC] terry dot cullen at uq dot edu dot au
bash-3.00# ld -V
ld: Software Generation Utilities - Solaris Link Editors: 5.10-1.482
 [2006-08-14 14:26 UTC] terry dot cullen at uq dot edu dot au
php5.2-200608141230 from snap.php.net fails in the same way.

Thanks for looking at this.
Terry
 [2006-08-14 14:36 UTC] tony2001@php.net
Please install and use GNU ld.
 [2006-08-14 14:57 UTC] terry dot cullen at uq dot edu dot au
Sadly, make failed again.

PATH='/opt/local/gcc/bin:/opt/local/php5/bin:/opt/local/perl/bin:/opt/local/mysql/mysql/bin:/usr/bin:/usr/sbin:/usr/ccs/bin:/usr/local/bin:/usr/bin/nsr:/usr/sbin/nsr:/usr/openwin/bin:/opt/csw/bin:/usr/sfw/bin:/usr/bin'
CFLAGS='-O3 -fPIC -L/opt/csw/lib' \
CPPFLAGS='-I/opt/csw/include -I/usr/include' \
LDFLAGS='-Wl,-rpath-link=/lib:/usr/lib:/opt/csw/lib:/opt/local/mysql/mysql/lib:/opt/local/mysql/mysql:/usr/sfw/lib:/opt/local/oracle/10103_client:/opt/local/oracle/10103_client/lib'

export CFLAGS CPPFLAGS LDFLAGS PATH


'./configure' \
'--prefix=/opt/local/php5' \
'--with-apxs2=/opt/local/apache/bin/apxs' \
'--enable-safe-mode' \
'--with-exec-dir=/opt/local/php5/bin' \
'--enable-bcmath' \
'--enable-gd-native-ttf' \
'--enable-soap' \
'--enable-sockets' \
'--disable-rpath' \
'--enable-ftp' \
'--with-gd' \
'--with-gettext' \
'--with-imap=/src/Web/IMap/imap-2004g' \
'--with-imap-ssl=/src/Web/IMap/imap-2004g' \
'--with-jpeg-dir=/usr/lib/amd64/' \
'--with-ldap=/usr' \
'--with-mcrypt=/opt/local' \
'--with-png-dir=/usr/lib/amd64/' \
'--with-pspell=/usr' \
'--with-openssl=/opt/csw' \
'--with-zlib' \
'--with-libxml-dir=/opt/csw' \
'--with-mysql=/opt/local/mysql/mysql' \
'--with-oci8=/opt/local/oracle/10103_client' \
'--with-xpm-dir=/usr/lib' \
'--enable-memory-limit' \
'--with-gdbm=/opt/csw' \
'--with-db4=/opt/csw/bdb4' \
'--with-mhash=/opt/local/mhash' \
'--with-curl=/opt/local/curl' \
'--with-pear=/opt/local/php5' \
'--enable-pdo=shared' \
'--with-pdo-sqlite=shared' \
'--with-sqlite=shared' \
'--with-mbstring' \
'--with-mysqli=/opt/local/mysql/mysql/bin/mysql_config' \
'--with-pdo-mysql=shared,/opt/local/mysql/mysql' \
'--with-gnu-ld' \
'--with-ld=/usr/sfw/i386-sun-solaris2.10/bin/ld'

with;
gcc: ext/pdo_mysql/.libs/pdo_mysql.o: No such file or directory
gcc: ext/pdo_mysql/.libs/mysql_driver.o: No such file or directory
gcc: ext/pdo_mysql/.libs/mysql_statement.o: No such file or directory
gmake: *** [ext/pdo_mysql/pdo_mysql.la] Error 1
 [2006-08-14 15:04 UTC] tony2001@php.net
Are you sure the ld binary used for the build is GNU ?
 [2006-08-14 15:08 UTC] terry dot cullen at uq dot edu dot au
Here is the relevant output from the configure script;
Configuring libtool
checking build system type... i386-pc-solaris2.10
checking for ld used by gcc... (cached) /usr/sfw/i386-sun-solaris2.10/bin/ld
checking if the linker (/usr/sfw/i386-sun-solaris2.10/bin/ld) is GNU ld... (cached) yes
checking for /usr/sfw/i386-sun-solaris2.10/bin/ld option to reload object files... (cached) -r
checking for BSD-compatible nm... (cached) /usr/ccs/bin/nm -p
checking how to recognise dependent libraries... (cached) pass_all
checking for object suffix... (cached) o
checking for executable suffix... (cached) no
checking the maximum length of command line arguments... (cached) 262144
checking command to parse /usr/ccs/bin/nm -p output from gcc object... (cached) ok
checking for objdir... (cached) .libs
checking for ar... (cached) ar
checking for ranlib... (cached) ranlib
checking for strip... (cached) strip
checking if gcc static flag  works... yes
checking if gcc supports -fno-rtti -fno-exceptions... (cached) no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/sfw/i386-sun-solaris2.10/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... solaris2.10 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... no
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool

I will put it in the path and have another go.
Terry
 [2006-08-14 15:29 UTC] tony2001@php.net
Ok, I see.
Give me some time, I'll try to figure out what's wrong there (building PHP on Solaris takes hours, *sigh*..) 
 [2006-08-14 20:11 UTC] tony2001@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2006-08-14 23:33 UTC] terry dot cullen at uq dot edu dot au
Hi Tony,
Thank you very much for this fix.  I really appreciate it.  I compiled Stable (5.2.x-dev) without problems.  Is it possible to compile 5.1.4 without pdo mysql and then compile PDO_MYSQL from the 5.2dev using pecl and add it in?  Or is the 5.2dev not compatiable with 5.1.4? Or is there a fixed 5.1.x somewhere that I am not aware of?  I have a few problems with the Zend Platform stuff not compatible with 5.2dev.

Thanks again.
Terry
 [2006-08-15 00:08 UTC] terry dot cullen at uq dot edu dot au
Working!!!
Ok... I'll summarize to help out others suffering from solaris. Dont compile with the pdo_mysql stuff.

PATH='/usr/sfw/i386-sun-solaris2.10/bin:/opt/local/gcc/bin:/opt/local/php5/bin:/opt/local/perl/bin:/opt/local/mysql/mysql/bin:/usr/bin:/usr/sbin:/usr/ccs/bin:/usr/local/bin:/usr/bin/nsr:/usr/sbin/nsr:/usr/openwin/bin:/opt/csw/bin:/usr/sfw/bin:/usr/bin'
CFLAGS='-O3 -fPIC -L/opt/csw/lib' \
CPPFLAGS='-I/opt/csw/include -I/usr/include' \
LDFLAGS='-Wl,-rpath-link=/lib:/usr/lib:/opt/csw/lib:/opt/local/mysql/mysql/lib:/opt/local/mysql/mysql:/usr/sfw/lib:/opt/local/oracle/10103_client:/opt/local/oracle/10103_client/lib'
export CFLAGS CPPFLAGS LDFLAGS PATH
'./configure' \
'--prefix=/opt/local/php5' \
'--with-apxs2=/opt/local/apache/bin/apxs' \
'--enable-safe-mode' \
'--with-exec-dir=/opt/local/php5/bin' \
'--enable-bcmath' \
'--enable-gd-native-ttf' \
'--enable-soap' \
'--enable-sockets' \
'--disable-rpath' \
'--enable-ftp' \
'--with-gd' \
'--with-gettext' \
'--with-imap=/src/Web/IMap/imap-2004g' \
'--with-imap-ssl=/src/Web/IMap/imap-2004g' \
'--with-jpeg-dir=/usr/lib/amd64/' \
'--with-ldap=/usr' \
'--with-mcrypt=/opt/local' \
'--with-png-dir=/usr/lib/amd64/' \
'--with-pspell=/usr' \
'--with-openssl=/opt/csw' \
'--with-zlib' \
'--with-libxml-dir=/opt/csw' \
'--with-mysql=/opt/local/mysql/mysql' \
'--with-oci8=/opt/local/oracle/10103_client' \
'--with-xpm-dir=/usr/lib' \
'--enable-memory-limit' \
'--with-gdbm=/opt/csw' \
'--with-db4=/opt/csw/bdb4' \
'--with-mhash=/opt/local/mhash' \
'--with-curl=/opt/local/curl' \
'--with-pear=/opt/local/php5' \
'--enable-pdo=shared' \
'--with-pdo-sqlite=shared' \
'--with-sqlite=shared' \
'--with-mbstring' \
'--with-mysqli=/opt/local/mysql/mysql/bin/mysql_config' \
'--with-ld=/usr/sfw/i386-sun-solaris2.10/bin/ld' \
'--with-gnu-ld' \

Download the fixed php snapshot. Unpack, and browse to the ext/pdo_mysql. You need to phpize but make sure that phpize sets the API version matching that of your php version.  Then run 
PHP_PDO_SHARED=1 ./configure --with-pdo-mysql=/opt/local/mysql/mysql because there is a bug in the configure script that doesn't set PHP_PDO_SHARED then run gmake, cp the pdo_mysql.so to your php ext dir and add the so to php.ini.

Thanks a lot Tony.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 08:01:29 2024 UTC