php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1624 Invalid argument to ld (-Wl,-rpath,...)
Submitted: 1999-06-29 09:13 UTC Modified: 1999-06-29 23:04 UTC
From: twp20 at cam dot ac dot uk Assigned:
Status: Closed Package: Compile Failure
PHP Version: 3.0.10 OS: RedHat Linux 6.0/Kernel 2.2.10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: twp20 at cam dot ac dot uk
New email:
PHP Version: OS:

 

 [1999-06-29 09:13 UTC] twp20 at cam dot ac dot uk
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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-06-29 23:04 UTC] sas at cvs dot php dot net
Use of --with-shared-apache is deprecated. If you want to use PHP as a shared module, use APXS. See INSTALL.DSO for more information.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 09:01:33 2025 UTC