php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34221 Compiling xmlrpc as shared fails other parts
Submitted: 2005-08-23 17:45 UTC Modified: 2005-08-28 02:46 UTC
From: dverspui at hotpop dot com Assigned:
Status: Closed Package: Compile Failure
PHP Version: 5.1.0RC1 OS: Fedora Core 2
Private report: No CVE-ID: None
 [2005-08-23 17:45 UTC] dverspui at hotpop dot com
Description:
------------
I succesfully compiled and installed PHP up till and including PHP version 5.0.4. I did not update or change any of the required rpm's I have installed on my system, however with none of the PHP 5.1.0 versions compilation succeeds. I have all XML related *-devel packages installed,
however the final linking stage of make fails with undefined references to XML related stuff. Am I missing something?

My configure command line:
./configure \
 --prefix=/opt/php5 \
 --host=i686-pc-linux-gnu \
 --with-apxs2=/usr/sbin/apxs \
 --enable-inline-optimization \
 --disable-debug \
 --with-layout=GNU \
 --enable-pic \
 --with-pear \
 --enable-safe-mode \
 --enable-magic-quotes \
 --enable-memory-limit \
 --enable-discard-path \
 --enable-force-cgi-redirect \
 --disable-rpath \
 --enable-bcmath \
 --enable-calendar \
 --enable-exif \
 --enable-ftp \
 --enable-shmop \
 --enable-sockets \
 --enable-sysvsem \
 --enable-sysvshm \
 --enable-ucd-snmp-hack \
 --enable-wddx \
 --with-regex=system \
 --with-pcre-regex=/usr \
 --with-exec-dir=/usr/bin \
 --with-bz2 \
 --with-curl \
 --with-db4=/usr \
 --with-gd \
   --with-jpeg-dir=/usr \
   --with-png-dir=/usr \
   --with-zlib-dir=/usr \
   --with-freetype-dir=/usr \
   --with-ttf=/usr \
   --enable-gd-native-ttf \
 --without-gdbm \
 --with-gettext \
 --with-gmp \
 --with-iconv \
 --with-imap=shared \
   --with-kerberos \
   --with-imap-ssl \
 --with-ldap=shared \
 --enable-mbstring=shared \
   --enable-mbregex \
 --with-mysql=shared,/usr \
 --with-mysqli=/usr/bin/mysql_config \
 --with-ncurses \
 --with-openssl \
 --with-pgsql=shared \
 --with-pspell \
 --with-unixODBC=shared,/usr \
 --with-zlib \
 --enable-dom \
 --enable-simplexml \
 --enable-libxml \
 --enable-xml \
 --with-xmlrpc=shared \
   --with-expat-dir=/usr \
 --with-xsl \
 --enable-mbstring=shared \
 --enable-pdo \
   --with-pdo-mysql=/usr \
   --with-pdo-pgsql=/usr \
 --with-xmlreader

Relevant configure output:
...
[Configuring extensions]
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path... /usr/bin/xml2-config
checking whether libxml build works... yes
...
checking whether to enable SimpleXML support... yes
...
checking whether to enable XML support... yes
checking libexpat install dir... no
checking for XMLReader support... yes
checking for XMLRPC-EPI support... yes, shared
checking libexpat dir for XMLRPC-EPI... /usr
checking iconv dir for XMLRPC-EPI... no
checking for xmlparse.h... no
checking for xmltok.h... no
...


Make fails at the point where everything is linked together, starting with sapi/cli/php:
ext/wddx/.libs/wddx.o(.text+0x3775): In function `php_wddx_deserialize_ex':
/spuymore/php-5.1.0RC1/ext/wddx/wddx.c:1134: undefined reference to `XML_ParserCreate'
ext/wddx/.libs/wddx.o(.text+0x3780):/spuymore/php-5.1.0RC1/ext/wddx/wddx.c:1136: undefined reference to `XML_SetUserData'
ext/wddx/.libs/wddx.o(.text+0x3793):/spuymore/php-5.1.0RC1/ext/wddx/wddx.c:1137: undefined reference to `XML_SetElementHandler'
ext/wddx/.libs/wddx.o(.text+0x37a0):/spuymore/php-5.1.0RC1/ext/wddx/wddx.c:1138: undefined reference to `XML_SetCharacterDataHandler'
ext/wddx/.libs/wddx.o(.text+0x37ae):/spuymore/php-5.1.0RC1/ext/wddx/wddx.c:1140: undefined reference to `XML_Parse'
ext/wddx/.libs/wddx.o(.text+0x37b7):/spuymore/php-5.1.0RC1/ext/wddx/wddx.c:1142: undefined reference to `XML_ParserFree'
ext/xml/.libs/xml.o(.text+0x2d6): In function `zm_info_xml':
/spuymore/php-5.1.0RC1/ext/xml/xml.c:271: undefined reference to `XML_ExpatVersion'
ext/xml/.libs/xml.o(.text+0x5bc): In function `xml_parser_dtor':
/spuymore/php-5.1.0RC1/ext/xml/xml.c:329: undefined reference to `XML_ParserFree'
ext/xml/.libs/xml.o(.text+0x188e): In function `php_xml_parser_create_impl':
/spuymore/php-5.1.0RC1/ext/xml/xml.c:1085: undefined reference to `XML_ParserCreate_MM'
ext/xml/.libs/xml.o(.text+0x18b5):/spuymore/php-5.1.0RC1/ext/xml/xml.c:1093: undefined reference to `XML_SetUserData'
ext/xml/.libs/xml.o(.text+0x1b24): In function `zif_xml_set_element_handler':
/spuymore/php-5.1.0RC1/ext/xml/xml.c:1174: undefined reference to `XML_SetElementHandler'
ext/xml/.libs/xml.o(.text+0x1bbd): In function `zif_xml_set_character_data_handler':
/spuymore/php-5.1.0RC1/ext/xml/xml.c:1193: undefined reference to `XML_SetCharacterDataHandler'
ext/xml/.libs/xml.o(.text+0x1c51): In function `zif_xml_set_processing_instruction_handler':
/spuymore/php-5.1.0RC1/ext/xml/xml.c:1212: undefined reference to `XML_SetProcessingInstructionHandler'
ext/xml/.libs/xml.o(.text+0x1ce5): In function `zif_xml_set_default_handler':
/spuymore/php-5.1.0RC1/ext/xml/xml.c:1230: undefined reference to `XML_SetDefaultHandler'
ext/xml/.libs/xml.o(.text+0x1d79): In function `zif_xml_set_unparsed_entity_decl_handler':
/spuymore/php-5.1.0RC1/ext/xml/xml.c:1249: undefined reference to `XML_SetUnparsedEntityDeclHandler'
ext/xml/.libs/xml.o(.text+0x1e0d): In function `zif_xml_set_notation_decl_handler':
/spuymore/php-5.1.0RC1/ext/xml/xml.c:1267: undefined reference to `XML_SetNotationDeclHandler'
ext/xml/.libs/xml.o(.text+0x1ea1): In function `zif_xml_set_external_entity_ref_handler':
/spuymore/php-5.1.0RC1/ext/xml/xml.c:1285: undefined reference to `XML_SetExternalEntityRefHandler'
ext/xml/.libs/xml.o(.text+0x1f35): In function `zif_xml_set_start_namespace_decl_handler':
/spuymore/php-5.1.0RC1/ext/xml/xml.c:1304: undefined reference to `XML_SetStartNamespaceDeclHandler'
ext/xml/.libs/xml.o(.text+0x1fc9): In function `zif_xml_set_end_namespace_decl_handler':
/spuymore/php-5.1.0RC1/ext/xml/xml.c:1323: undefined reference to `XML_SetEndNamespaceDeclHandler'
ext/xml/.libs/xml.o(.text+0x2098): In function `zif_xml_parse':
/spuymore/php-5.1.0RC1/ext/xml/xml.c:1352: undefined reference to `XML_Parse'
ext/xml/.libs/xml.o(.text+0x22bc): In function `zif_xml_parse_into_struct':
/spuymore/php-5.1.0RC1/ext/xml/xml.c:1388: undefined reference to `XML_SetDefaultHandler'
ext/xml/.libs/xml.o(.text+0x22d1):/spuymore/php-5.1.0RC1/ext/xml/xml.c:1389: undefined reference to `XML_SetElementHandler'
ext/xml/.libs/xml.o(.text+0x22e0):/spuymore/php-5.1.0RC1/ext/xml/xml.c:1390: undefined reference to `XML_SetCharacterDataHandler'
ext/xml/.libs/xml.o(.text+0x2300):/spuymore/php-5.1.0RC1/ext/xml/xml.c:1393: undefined reference to `XML_Parse'
ext/xml/.libs/xml.o(.text+0x2436): In function `zif_xml_get_error_code':
/spuymore/php-5.1.0RC1/ext/xml/xml.c:1412: undefined reference to `XML_GetErrorCode'
ext/xml/.libs/xml.o(.text+0x24b1): In function `zif_xml_error_string':
/spuymore/php-5.1.0RC1/ext/xml/xml.c:1427: undefined reference to `XML_ErrorString'
ext/xml/.libs/xml.o(.text+0x25a2): In function `zif_xml_get_current_line_number':
/spuymore/php-5.1.0RC1/ext/xml/xml.c:1446: undefined reference to `XML_GetCurrentLineNumber'
ext/xml/.libs/xml.o(.text+0x2612): In function `zif_xml_get_current_column_number':
/spuymore/php-5.1.0RC1/ext/xml/xml.c:1462: undefined reference to `XML_GetCurrentColumnNumber'
ext/xml/.libs/xml.o(.text+0x2682): In function `zif_xml_get_current_byte_index':
/spuymore/php-5.1.0RC1/ext/xml/xml.c:1478: undefined reference to `XML_GetCurrentByteIndex'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-23 23:51 UTC] sniper@php.net
Try with a bit shorter configure line. You have several options in there which you should NOT be using. Do you really know what you're doing. Also, don't try building any extensions as shared. That doesn't give you anything.
Do this:

# rm config.cache && ./configure --disable-all <other options>

Where <other options> are those you:

a) Know you need 
b) Know what they do
c) Are actually used when compiling apache2 DSO..


 [2005-08-24 10:53 UTC] dverspui at hotpop dot com
Hi Sniper, thanks for your comment.
I actually made up this configure line very carefully, based on the components I do really use and to make the PHP5 installation best compatible with PHP4 versions that originally shipped with Fedora Core 2 (except for the
extensions that are moved to PECL off course). I succeeded with that up till 5.0.4 with this very configure line, I only adapted it to changes in configure itself.

I agree I could remove some of the options but these
are not XML related, so I do not really see why that would
eliminate the undefined reference errors? I would appreciate it if you could help me eliminate the error instead of having me remove extensions I use. In the meantime I will try building without shared extensions.

Thanks,

Dennis
 [2005-08-24 11:39 UTC] sniper@php.net
I wanted to see what the shortest possible configure line is
that still causes the compile failure to be able to try this myself. I don't want to use that whole line. And you really have options there you should not be using.
Do you _really_ know what these do:

--enable-inline-optimization
--enable-pic
--enable-discard-path
--enable-force-cgi-redirect
--disable-rpath
--enable-ucd-snmp-hack
--with-regex=system

 [2005-08-24 14:08 UTC] dverspui at hotpop dot com
Ha, apart from enable-inline-optimization and with-regex=system I have only the understanding of what the options you refer to mean by what configure --help tells me. Do not understand me wrong, I really try to understand what them, but whenever I didn't care I just took over the configure options the Red Hat guys used when building the shipped php4 versions.

With trial and error I now found out that since 5.0.4 mbstring and xmlrpc fail to compile as shared extensions, I now linked them statically and compilation succeeds without errors. I want to thank you for your feedback and have one more remaining question. Why is it that you say that I should not compile extensions as shared? I thought it might save runtime memory until the extensions are used. The PHP5 module gets rather big (about 5Mb stripped) when I compile all extensions statically. Does it, or do I understand this wrong?
 [2005-08-24 14:17 UTC] sniper@php.net
Free hint: Nuke the options I mentioned. (and from now on, don't always trust RedHat doing the right thing (tm))

 [2005-08-28 02:46 UTC] sniper@php.net
Fixed in CVS now. Will be fixed in PHP 5.1 and later.

NOTE: --with-expat-dir is renamed to --with-libexpat-dir to be consistent with the other parts using it!

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 07 08:01:28 2024 UTC