|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34516 relocations remain against allocatable but non-writable sections
Submitted: 2005-09-15 18:07 UTC Modified: 2006-01-31 09:37 UTC
From: milan dot magudia at pa dot press dot net Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.1.0RC1 OS: Solaris 8
Private report: No CVE-ID:
 [2005-09-15 18:07 UTC] milan dot magudia at pa dot press dot net
I'm having a very similar issue to bug 33476 which was marked as bogus

Reproduce code:
Compiling php-5.0.4 / php-5.0.5 has no problems with this configure setup, but always fails to compile any php-5.1b/rc with these settings.

'./configure' '--with-apxs=/opt/PAAPACHE_1.3.26/bin/apxs' '--with-mysql=/usr/local/mysql' '--with-gd' '--with-jpeg-dir=/usr/local/lib' '--with-png-dir=/usr/local/lib' '--with-xpm-dir=/usr/local/lib' '--with-freetype-dir=/usr/local/lib' '--with-tiff-dir=/usr/local/lib' '--enable-exif' '--with-pear' '--with-gettext=/usr/local/lib' '--enable-mbstring' '--enable-mbregex' '--with-readline=/usr/local/lib' '--with-iconv=/usr/local' '--enable-mime-magic' '--with-curl=/usr/local/lib' '--enable-ftp' '--with-xsl' '--with-expat-dir=/usr/local/lib' '--enable-soap' '--with-libxml-dir=/usr/local/lib' '--enable-wddx' '--enable-calender' '--with-mcrypt=/usr/local/lib' '--with-mhash=/usr/local/lib' '--with-openssl=/usr/local/ssl' '--with-zlib-dir=/usr/local/lib' '--with-zlib=/usr/local' '--with-xmlrpc' '--with-pdo-mysql=/usr/local/mysql'

Actual result:
The problem this time seems to be related to mysql, but the general error seems to be identical. I've tried to compile this source of php-5.1 on two different machines, both solaris 8. When I exclude the --with-mysql options then everything else compiles fine for the 5.1 source.

(many lines of libmysqlclient.a errors)
memset                              0xbc        /usr/local/mysql/lib/libmysqlclient.a(my_lib.o)
memset                              0xc         /usr/local/mysql/lib/libmysqlclient.a(vio.o)
memset                              0x54        /usr/local/mysql/lib/libmysqlclient.a(vio.o)
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status
make: *** [] Error 1

As I said all previous builds compiles fine, but no 5.1 builds will compile with duplicate settings. I can only think something must of changed between 5.0 and 5.1 related to the use of ld. Also both 5.0 and 5.1 the solaris version is used. Any feedback would be appreciated as all similar bugs have had no clear resolution?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-15 19:30 UTC]
Search google with this string:
"relocations remain against allocatable but non-writable"

Short: Use GNU tools. (GCC, GNU ld, etc.)

 [2005-09-27 11:36 UTC] milan dot magudia at pa dot press dot net
I now agree that you are right that this is bogus, i've managed to recompile gcc against a gnu ld. Unfortunately my gnu version of ld was buggy, so that had to be recompiled as well. In short a lot of things were recompiled to the gbu versions and I finally got a successful build.

What I don't really understand is that all versions <5.1 did compile with gcc built against the solaris ld, but for now I'm just glad it's working.
 [2006-01-31 09:37 UTC]
If you are using MySQL binaries provided by MySQL website and gcc from SunFreeware the problem lies in two different points. Sunfreeware gcc uses sun ld and not gnu ld:

#gcc -v
Reading specs from /usr/local/lib/gcc-lib/i386-pc-solaris2.10/3.3.6/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls --disable-libgcj

and the MySQL binaries don't provide shared libraries. Workaround for this is to build MySQL shared libraries (or whole MySQL if you want) by yourself and then build PHP against them. 

#./configure --prefix=/usr/local/mysql-lib --without-server
#make && make install
... then php ...
#./configure --with-mysql=/usr/local/mysql-lib --with-mysqli=/usr/local/mysql-lib/bin/mysql_config

I don't understand why shared libraries arent provided with the MySQL binaries in the first place.
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Thu Jan 19 15:01:40 2017 UTC