php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5882 Use inline directive in *.c files for global functions in Zend engine
Submitted: 2000-07-31 21:45 UTC Modified: 2001-06-01 15:28 UTC
From: mbaturin at mail dot ru Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4.0.1pl2 OS: SGI Irix 6.5.8
Private report: No CVE-ID: None
 [2000-07-31 21:45 UTC] mbaturin at mail dot ru
In Zend engine uses a inline modificator for functions which uses globaly, not only in  module, where it was define.
Compiller say - no errors, becouse thats functions defined in *.h file as global, but implementation this function defined as inline - and after compiling to *.o object file cc compiler remove this function from global lists (marked as LOCAL)
And in result engine didn't started 
when try to run httpd with dinamicly linked libphp4.so:
#dbx /usr/local/apache/bin/httpd
>run -X -f/usr/local/apache/conf/httpd.conf
all OK
but when we make request to *.php file from browser dbx say:
Error: unable to resolve _array_init function...
and httpd process down to core
#nm libphp4.so
show that this function have status UNDEF
Solve this bug with this script:
#!/bin/sh
cd php-4.0.1pl2/Zend
for i in `grep -l "ZEND_API inline" *.c` ; do                                                    
    mv $i $i.old                                                                                 
    sed -e 's/ZEND_API inline/ZEND_API/g' $i.old >$i                                             
 done
 #end of script
After recompile - all OK

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-04 11:36 UTC] stas@php.net
Which compiler do you use?
 [2000-08-15 07:33 UTC] stas@php.net
Looks like problem in the compiler, because these functions aren't declared static. I'll try to look into the standard and see what compiler is supposed to do with inlines. Also, gcc has option "-fkeep-inline-functions" - does yours have one?

Finally, most useful slution for you might be to add -Dinline= to you CFLAGS. That will hurt performance a bit, but otherwise should work.
 [2000-08-15 12:42 UTC] sas@php.net
The user probably needs to configure PHP with --enable-c9x-inline

Please try this and report back to us whether it works for you.
 [2000-08-30 05:08 UTC] stas@php.net
User environment:
MIPSPro C 7.3.1.1
IRIX 6.5.8


 [2000-11-01 02:09 UTC] andi@php.net
Does this still happen with the latest version? Try 4.0.3pl1 or get the latest snapshot from snaps.php.net.
Thanks,

Andi
 [2000-11-21 06:12 UTC] sniper@php.net
Please try the latest snapshot from http://snaps.php.net/
as this should be fixed now.

--Jani
 [2000-12-07 19:42 UTC] sniper@php.net
User feedback:
------------
Yes, still not working.
When run httpd -X and try to open .php file this message:
98571:/usr/local/apache/bin/httpd: rld: Fatal Error: attempted access to
unresolvable symbol in /usr/local/apache/libexec/libphp4.so: _array_init

MIPSPro C 7.3.1.1
IRIX 6.5.8

In .c files you still use static inline functions, which not supported for
exporting in SGI C compiller.
-----------------

 [2001-05-06 11:08 UTC] derick@php.net
Is this still the case with Php 4.0.5?
 [2001-06-01 15:28 UTC] sniper@php.net
No feedback. I assume this problem still exists but
as this bug reporter doesn't answer, I'll close this report.
There are other reports about this too.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 14:01:30 2024 UTC