note 60755 deleted from install.unix.solaris by bjori
| From: | bjori@php.net | Date: | Wed, 22 Mar 2006 20:24:21 +0000 |
| Subject: | note 60755 deleted from install.unix.solaris by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-106362@lists.php.net to get a copy of this message | ||
Note Submitter: ozone at cname dot com
----
building php versions 5.1 or later on solaris with mysql support (where mysql was installed from a
binary package) results in this error:
ld: fatal: relocations remain against allocatable but non-writable sections
root cause: mysql binary packages do not include shared libraries (or static libraries with
relocatable code). it does not matter whose ld is used; i tried both /usr/ccs/bin and the current
gnu binutils.
fix: build mysql from source. i used these options:
CFLAGS="-O3 -mcpu=v8 -Wa,-xarch=v8plusa" \
CXX=gcc \
CXXFLAGS="-O3 -mcpu=v8 -Wa,-xarch=v8plusa \
-felide-constructors -fno-exceptions -fno-rtti" \
./configure \
--prefix=/usr/local/mysql --enable-assembler \
--with-unix-socket-path=/tmp/mysql.sock \
--with-mysqld-user=mysql --with-zlib-dir=/usr/local \
--with-openssl=/usr/local --prefix=/opt/mysql
note that the v8 cpu options assume ultrasparc; anyone running supersparc hardware should upgrade to
netbsd first. mysql documentation recommends the "--with-mysqld-ldflags=-all-static"
option, but this is not compatible with ssl support.
after the compile finishes (with older machines, this takes long enough for coffee or a quick
lunch), install. inform solaris of the new libraries with an appropriate incantation of crle(1),
such as
crle -c /var/ld/ld.config -l CURRENT_LIB_PATH:/opt/mysql/lib/mysql
next, build php. i used the following options:
CFLAGS="-mcpu=v8 -Wa,-xarch=v8plusa" \
CXXFLAGS="-mcpu=v8 -Wa,-xarch=v8plusa \
-felide-constructors -fno-exceptions -fno-rtti" \
'./configure' \
'--prefix=/usr/local' \
'--with-apxs2=/usr/local/bin/apxs' \
'--with-mysql=/opt/mysql' \
'--with-xsl=/usr/local' \
'--with-openssl=/usr/local' \
'--with-gd=/usr/local' \
'--with-mysql-sock=/tmp/mysql.sock' \
'--with-zlib' \
'--with-zlib-dir=/usr/local' \
'--enable-sockets'
compile and install. hopefully the above will help someone; i burned way too much development time
tracking this down (and waiting for multiple compile runs)...
the resulting php fails tests for these bugs: 24640 32555 33532 35785 and 32001. everything else
"seems to work".