php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23758 Must link -lgcc_s rather than -lgcc
Submitted: 2003-05-22 12:04 UTC Modified: 2004-03-08 21:24 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:3 (100.0%)
From: pbriggs at clinitech dot net Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 4CVS, 5CVS OS: HPUX 11.00
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: pbriggs at clinitech dot net
New email:
PHP Version: OS:

 

 [2003-05-22 12:04 UTC] pbriggs at clinitech dot net
PHP-4.3.2RC4 on HP-UX 11.00

./configure --prefix=/opt/php --with apxs2=/opt/apache/bin/apxs --with-mysql=/opt/mysql4 -enable libgcc --enable-sockets

In order to avoid "unresolved symbol: __umoddi3" error when attempting to start Apache 2 with PHP as a module, I must use the configure option --enable-libgcc.  Because -lgcc is not a shared library, PHP does not compile a shared object that Apache can use as a module.  A static libphp4.a object is created in .libs directory.

What I have done is rerun the linker step manually by copying and pasting the long linker command on my telnet terminal.  I then substitute -lgcc with -lgcc_s and that make libtool happy which then creates the correct shared object libphp4.sl in .libs which Apache can then load as a module.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-22 17:02 UTC] sniper@php.net
Did you try without --enable-libgcc ??
What gcc version are you using? Did you have some older
version installed before you installed the new one?

 [2003-05-22 17:37 UTC] pbriggs at clinitech dot net
The version of GCC is 3.3.  I have had previous versions of PHP installed, but in each case, I had to link libgcc_s.1 when its being used as an Apache module.

I just attempted to leave out --enable-libgcc, and what I get is this error from Apache 2.0.45:

Cannot load /opt/apache/modules/libphp4.so into server: Unresolved external: __umoddi3

The function its looking for is apparently in libgcc, so I have to compile with --enable-libgcc to take care of the problem.  This appears to be documented in bugs 16808, 15189, 12222, 12232.

Using --enable-libgcc fixes the issue, but in the case of an Apache as a module, it needs to be the shared version lgcc_s to avoid libtool creating a static, rather than shared object for Apache.

The only thing I haven't tried is maybe making a symbolic link of libgcc.sl -> libgcc_s.1, but I'm not sure if that is really the best solution.
 [2003-05-22 18:07 UTC] sniper@php.net
Try this:

CFLAGS=-shared-libgcc ./configure --disable-cli ..plus your options..

(and leave the --enable-libgcc part out)

 [2003-05-22 18:45 UTC] pbriggs at clinitech dot net
Ok, tried as you suggested.  Same error.
 [2004-01-27 17:20 UTC] pbriggs at clinitech dot net
Same issue exists in version 4.3.5RC1.  This time I did ./configure process, edited the Makefile and changed -lgcc to -lgcc_s.  That produced the corrected module that I could load into Apache2.
 [2004-03-08 21:11 UTC] pbriggs at clinitech dot net
If I use the GCC 3.3.2 binary provided by the HP Software and Porting Archive at http://hpux.cs.utah.edu/ they don't include a libgcc_s.sl, so when I compiled PHP, I didn't specify the -enable-libgcc on the ./configure command.  

Everything compiled and install fine without needing lgcc_s.  I'm not sure how their binary differs from mine when I compiled GCC myself.
 [2004-03-08 21:24 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Does not appear like a PHP bug. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Sep 17 13:01:26 2024 UTC