Bug #1624: Invalid argument to ld (-Wl,-rpath,...)
| From: | twp20 at cam dot ac dot uk | Date: | Tue, 29 Jun 1999 13:13:44 +0000 |
| Subject: | Bug #1624: Invalid argument to ld (-Wl,-rpath,...) | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-7799@lists.php.net to get a copy of this message | ||
From: twp20@cam.ac.uk
Operating system: RedHat Linux 6.0/Kernel 2.2.10
PHP version: 3.0.10
PHP Bug Type: Compile Failure
Bug description: Invalid argument to ld (-Wl,-rpath,...)
PHP configuration:
./configure --with-shared-apache=../apache-1.3.6 --with-mysql=/usr/local/mysql --with-gd
--enable-track-vars --without-pcre-regex
(configures, makes, and installs okay)
Apache 1.3.6 configuration:
./configure --prefix=/usr/local/apache --activate-module=src/modules/php3/libphp3.a
--enable-module=php3 --enable-shared=max
Configures okay, but ld dies on make with error 'Invalid option
-Wl,-rpath,/usr/local/mysql/lib/mysql'.
Explanation:
Default libphp3.module contains:
Name: php3_module
ConfigStart
RULE_WANTHSREGEX=yes
LIBS="-Wl,-rpath,/usr/local/mysql/lib/mysql -lpam -lm -ldl -lcrypt -lnsl -lresolv $LIBS
-lgdbm -lgd -L/usr/local/mysql/lib/mysql -lmysqlclient"
RULE_HIDE=yes
ConfigEnd
When compiling Apache $LIBS gets passed to ld. ld doesn't understand the
-Wl,-rpath,/usr/local/mysql/lib/mysql option and dies.
Quick fix is modify libphp3.module to be:
Name: php3_module
ConfigStart
RULE_WANTHSREGEX=yes
CFLAGS="$CFLAGS -Wl,-rpath,/usr/local/mysql/lib/mysql"
LIBS="-lpam -lm -ldl -lcrypt -lnsl -lresolv $LIBS -lgdbm -lgd -L/usr/local/mysql/lib/mysql
-lmysqlclient"
RULE_HIDE=yes
ConfigEnd
This ensures that -Wl,-rpath,... is only passed to gcc, and is not passed to ld.
Proper fix: modify configure script to generate libphp3.module as above.
N.B. I don't have much experience developing under Unix so I may be barking up the wrong
tree...
Regards,
Tom