Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
05-29-2012, 05:17 PM
|
#1
|
|
Senior Member
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,888
Rep:
|
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
chmod 755 src/phc_compile_plugin
libtool: link: g++ -Wextra -Wno-unused-parameter -Wno-write-strings -Wno-deprecated -g -O2 -o src/.libs/phc phc.o -Wl,--export-dynamic /usr/lib/i386-linux-gnu/libltdl.so -lboost_regex-mt ./.libs/libphc.so -L/usr/lib -L/usr/local/php/lib /usr/lib/libxerces-c.so -lnsl -lpthread -lgccpp -lgc -lphp5 -ldl -lboost_regex -Wl,-rpath -Wl,/usr/local/phc/lib
/usr/local/php/lib/libphp5.so: undefined reference to `ap_get_server_version'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_sub_req_lookup_uri'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_pass_brigade'
/usr/local/php/lib/libphp5.so: undefined reference to `apr_bucket_eos_create'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_loaded_modules'
/usr/local/php/lib/libphp5.so: undefined reference to `apr_pool_cleanup_null'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_rflush'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_add_common_vars'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_log_error'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_update_mtime'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_set_content_length'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_run_sub_req'
/usr/local/php/lib/libphp5.so: undefined reference to `apr_pool_userdata_get'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_add_version_component'
/usr/local/php/lib/libphp5.so: undefined reference to `apr_pool_userdata_set'
/usr/local/php/lib/libphp5.so: undefined reference to `apr_palloc'
/usr/local/php/lib/libphp5.so: undefined reference to `apr_brigade_flatten'
/usr/local/php/lib/libphp5.so: undefined reference to `apr_pstrdup'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_mpm_query'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_server_root_relative'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_hook_child_init'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_server_root'
/usr/local/php/lib/libphp5.so: undefined reference to `apr_brigade_create'
/usr/local/php/lib/libphp5.so: undefined reference to `apr_table_elts'
/usr/local/php/lib/libphp5.so: undefined reference to `apr_snprintf'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_log_rerror'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_auth_type'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_add_cgi_vars'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_hook_pre_config'
/usr/local/php/lib/libphp5.so: undefined reference to `apr_table_set'
/usr/local/php/lib/libphp5.so: undefined reference to `apr_table_unset'
/usr/local/php/lib/libphp5.so: undefined reference to `apr_brigade_cleanup'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_set_content_type'
/usr/local/php/lib/libphp5.so: undefined reference to `apr_pool_cleanup_register'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_hook_post_config'
/usr/local/php/lib/libphp5.so: undefined reference to `apr_pool_cleanup_run'
/usr/local/php/lib/libphp5.so: undefined reference to `apr_psprintf'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_hook_handler'
/usr/local/php/lib/libphp5.so: undefined reference to `apr_table_add'
/usr/local/php/lib/libphp5.so: undefined reference to `apr_table_get'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_set_last_modified'
/usr/local/php/lib/libphp5.so: undefined reference to `unixd_config'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_get_brigade'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_destroy_sub_req'
/usr/local/php/lib/libphp5.so: undefined reference to `ap_rwrite'
collect2: ld returned 1 exit status
make[2]: *** [src/phc] Error 1
make[2]: Leaving directory `/home/antoranz/Descargas/php/phc/phc-0.3.0.1'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/antoranz/Descargas/php/phc/phc-0.3.0.1'
make: *** [all] Error 2
Where are those symbols defined? Thanks in advance.
|
|
|
|
05-29-2012, 05:33 PM
|
#2
|
|
Senior Member
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,888
Original Poster
Rep:
|
Fairly interesting... the symbols are in libphp5 from the php5.2 I installed:
Code:
$ nm -gC /usr/local/php/lib/libphp5.so | grep " apr"
U apr_brigade_cleanup
U apr_brigade_create
U apr_brigade_flatten
U apr_bucket_eos_create
U apr_palloc
U apr_pool_cleanup_null
U apr_pool_cleanup_register
U apr_pool_cleanup_run
U apr_pool_userdata_get
U apr_pool_userdata_set
U apr_psprintf
U apr_pstrdup
U apr_snprintf
U apr_table_add
U apr_table_elts
U apr_table_get
U apr_table_set
U apr_table_unset
Then why the hell can't the linker see it? Hell!
|
|
|
|
05-29-2012, 05:37 PM
|
#3
|
|
Senior Member
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,888
Original Poster
Rep:
|
Oh.... I see it.... U is for 'undefined'... so they must be defined somwehere else, ain't that right?
|
|
|
|
05-29-2012, 05:43 PM
|
#4
|
|
Senior Member
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,888
Original Poster
Rep:
|
I just checked all so files in my box and there are no symbols with those names anywhere.... what's the trick then?
|
|
|
|
05-29-2012, 08:10 PM
|
#5
|
|
Senior Member
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,888
Original Poster
Rep:
|
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
I'm facing a problem of another kind so when I finish compiling (or it fails), I'll let you know.
|
|
|
|
05-29-2012, 09:59 PM
|
#6
|
|
Senior Member
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,888
Original Poster
Rep:
|
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
/usr/local/phc/bin/phc: symbol lookup error: /usr/local/php/lib/libphp5.so: undefined symbol: apr_pool_cleanup_null
So.... what can I try next?
|
|
|
|
05-30-2012, 09:34 AM
|
#7
|
|
Senior Member
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,888
Original Poster
Rep:
|
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
What am I missing now?
|
|
|
|
05-30-2012, 10:28 AM
|
#8
|
|
Senior Member
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,888
Original Poster
Rep:
|
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 helloworld
PHP Warning: Internal error: Cannot find extension function __MAIN__ in global function table in Unknown on line 0
Extension [ <persistent> extension #24 helloworld version 1.0 ] {
- Functions {
}
}
There are some __MAIN__ symbols in the so:
Code:
$ nm -gC modules/helloworld.so | grep MAIN
00004180 B helloworld___MAIN___arg_info
000010b0 T zif___MAIN__
What did I miss now?
|
|
|
|
05-30-2012, 11:34 AM
|
#9
|
|
Senior Member
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,888
Original Poster
Rep:
|
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
w _Jv_RegisterClasses
000020c8 A __bss_start
w __cxa_finalize@@GLIBC_2.1.3
w __gmon_start__
000020c8 A _edata
000020d0 A _end
U _estrndup
00000588 T _fini
000003a4 T _init
00000530 T get_module
00002040 D hello_module_entry
000004e0 T zif_hello_world
So... there's no __MAIN__ stuff or something like that... I thought that was kind of mandatory.... and that makes me think that probably the code generated by phc has a problem... what a crash course.
Last edited by eantoranz; 05-30-2012 at 11:37 AM.
Reason: Forgot to include link
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 04:13 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|