![]() |
where are apache symbols?
Hi!
I'm trying to build phc and I find that in the configuration process, there's an error when checking for something about zend strings.... because of missing symbols (related to apache). I hacked the configure script just to see what happened and it finished successfully... however, when I try to compile phc, I get the same problem with apache symbols: Code:
/bin/bash ./libtool --tag=CXX --mode=link g++ -Wextra -Wno-unused-parameter -Wno-write-strings -Wno-deprecated -g -O2 -export-dynamic -o src/phc phc.o -lgc -lgccpp -lltdl -lboost_regex-mt libphc.la -lxerces-c -lgccpp -lgc -lphp5 -L/usr/local/php/lib -ldl -lboost_regex |
Fairly interesting... the symbols are in libphp5 from the php5.2 I installed:
Code:
$ nm -gC /usr/local/php/lib/libphp5.so | grep " apr" |
Oh.... I see it.... U is for 'undefined'... so they must be defined somwehere else, ain't that right?
|
I just checked all so files in my box and there are no symbols with those names anywhere.... what's the trick then?
|
Reading this article shed some light on what's going on: http://blog.flameeyes.eu/2010/09/you...efined-symbols
So in phc's configure I'm defining those symbols as undefinded: Code:
LDFLAGS="-u ap_hook_child_init -u apr_table_elts -u apr_table_unset -u apr_pool_cleanup_register -u ap_rflush -u ap_pass_brigade -u apr_brigade_create -u ap_sub_req_lookup_uri -u ap_server_root -u apr_pool_cleanup_null -u ap_destroy_sub_req -u ap_mpm_query -u ap_add_cgi_vars -u ap_set_last_modified -u ap_set_content_length -u ap_hook_post_config -u ap_get_server_version -u apr_pool_userdata_get -u ap_hook_handler -u ap_rwrite -u apr_psprintf -u apr_palloc -u apr_brigade_cleanup -u unixd_config -u apr_snprintf -u ap_get_brigade -u ap_add_common_vars -u apr_table_add -u apr_bucket_eos_create -u ap_add_version_component -u ap_log_error -u ap_hook_pre_config -u apr_pool_userdata_set -u apr_pool_cleanup_run -u apr_pstrdup -u ap_set_content_type -u apr_table_get -u ap_run_sub_req -u ap_loaded_modules -u ap_server_root_relative -u apr_table_set -u ap_update_mtime -u apr_brigade_flatten -u ap_log_rerror -u ap_auth_type" ./configure --with-php=/usr/local/php --prefix=/usr/local/phc |
Compilation was successful... but then it wasn't going to give itself away so easily, would it?
Code:
$ /usr/local/phc/bin/phc -c Hello.php -o hello-world |
I think I almost nailed... though without the apache symbols.
The thing is that in order to build phc, I'll have to use php _without_ apache module support. But then, in order to build my phc-compiled shared library as a php module, I'll have to use php _with_ apache.... so how about having two separate compilations of PHP? One with apache and one without? I just tried. I compiled phc against php without apache and it works fine. Then I compiled the c code generated against php with apache. Then, I modified php.ini to include this extension, then I restarted apache, I saw this in error.log Code:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-zts-20060613/helloworld.so' - /usr/local/php/lib/php/extensions/no-debug-zts-20060613/helloworld.so: undefined symbol: compiler_globals in Unknown on line 0 |
Now, this is very interesting. I built and enabled the module in php full (meaning, with apache support).
When I ask php for information about this module it says the module can¿t be loaded because __MAIN__ is not defined. Code:
$ /usr/local/php/bin/php --re helloworldCode:
$ nm -gC modules/helloworld.so | grep MAIN |
This is very interesting.... I built a tiny extension following this example: http://devzone.zend.com/303/extensio...-php-and-zend/
Look at the symbols in the file: Code:
$ nm -gC modules/hello.so |
| All times are GMT -5. The time now is 06:56 PM. |