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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 17 22:01:28 2024 UTC