Opened 15 years ago

Closed 15 years ago

#20239 closed defect (invalid)

php5 can't seem to use libxml2

Reported by: jhi Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 1.7.1
Keywords: Cc: jyrkiwahlstedt
Port: php5

Description (last modified by blb@…)

$ sudo port -v install ph5p
...
checking for atoll... yes
checking for strftime... (cached) yes
checking which regex library to use... php
checking whether to enable LIBXML support... yes
checking libxml2 install dir... /opt/local
checking for xml2-config path... /opt/local/bin/xml2-config
checking whether libxml build works... no
configure: error: build test failed.  Please check the config.log for details.

Warning: the following items did not execute (for php5): org.macports.activate org.macports.configure org.macports.build org.macports.destroot org.macports.install
Error: Status 1 encountered during processing.

The libxml is happily installed, I checked with "sudo port install libxml", which ends up not installing it because the latest libxml already installed. If I look at the config.log (/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_php5/work/php-5.3.0/config.log), I see at the end:

...
configure:20354: /usr/bin/gcc-4.0 -o conftest -O2 -gstabs -fvisibility=hidden -I/opt/local/include -no-cpp-precomp -L/opt/local/lib -Wl,-rpath,/opt/local/lib -L/opt/local/lib conftest.c 
          
         -lm  -lxml2 -lz -liconv -lm 1>&5
configure: failed program was:
#line 20343 "configure"
#include "confdefs.h"

    
    char xmlInitParser();
    int main() {
      xmlInitParser();
      return 0;
    }

Which will not work since the compile command is missing -lxml. If I create conftest.c with the above content, and copy the confdefs.h from the directory of config.log, AND add the -lxml, the test compiles and links. If I leave out the -lxml, I get this error:

Undefined symbols:
  "_xmlInitParser", referenced from:
      _main in ccGooSIo.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

So the configure test is missing -lxml?

Attachments (1)

config.log.gz (5.3 KB) - added by jhi 15 years ago.
The gzipped /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_php5/work/php-5.3.0/config.log

Download all attachments as: .zip

Change History (8)

comment:1 Changed 15 years ago by blb@…

Cc: jwa@… added
Description: modified (diff)
Owner: changed from macports-tickets@… to ryandesign@…

Actually not using -lxml is correct, it should be using -lxml2 (and appears to be doing so). Odd that it isn't finding that symbol, what is the output from running the following?

nm /opt/local/lib/libxml2.2.dylib |grep xmlInitParser

comment:2 Changed 15 years ago by jhi

$ nm /opt/local/lib/libxml2.2.dylib |grep xmlInitParser
0000c4f0 T _xmlInitParser
000081b0 T _xmlInitParserCtxt
$ 

comment:3 in reply to:  1 ; Changed 15 years ago by jhi

Replying to blb@…:

Actually not using -lxml is correct, it should be using -lxml2 (and appears to be doing so). Odd that it isn't finding that symbol, what is the output from running the following?

It is not using -lxml2, I think. As I said, from the config.log:

configure:20354: /usr/bin/gcc-4.0 -o conftest -O2 -gstabs -fvisibility=hidden -I/opt/local/include -no-cpp-precomp -L/opt/local/lib -Wl,-rpath,/opt/local/lib -L/opt/local/lib conftest.c

nm /opt/local/lib/libxml2.2.dylib |grep xmlInitParser

Changed 15 years ago by jhi

Attachment: config.log.gz added

The gzipped /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_php5/work/php-5.3.0/config.log

comment:4 in reply to:  3 ; Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: php5 fails to build in 10.5.7 because of faulty detection of libxmlphp5 can't seem to use libxml2

Replying to jhi@…:

It is not using -lxml2, I think. As I said, from the config.log:

configure:20354: /usr/bin/gcc-4.0 -o conftest -O2 -gstabs -fvisibility=hidden -I/opt/local/include -no-cpp-precomp -L/opt/local/lib -Wl,-rpath,/opt/local/lib -L/opt/local/lib conftest.c

The command continues on the next line with "-lm -lxml2 -lz -liconv -lm".

php5 builds fine for me on my Mac OS X 10.5.7 Intel system so something must be different about yours.

Running blb's nm command on my system I get:

         U _xmlInitParser
000091cd T _xmlInitParserCtxt
00020379 T _xmlInitParser
         U _xmlInitParser
         U _xmlInitParser
         U _xmlInitParser
         U _xmlInitParser

Since that's different than what you got, could you please try rebuilding your libxml2, after you sync and update outdated ports to make sure you have the latest software?

sudo port sync
port outdated
sudo port upgrade outdated

If that did not already upgrade libxml2, then force it like this:

sudo port -nf upgrade libxml2

comment:5 Changed 15 years ago by blb@…

FWIW, mine is similar to jhi@:

00022550 T _xmlInitParser
00009b30 T _xmlInitParserCtxt

Ryan, not sure why you're seeing the undefined references as well...though PHP5 5.3.0 works fine here too.

One other thing, make sure there are no libxml2* files in /usr/local/lib.

comment:6 in reply to:  4 Changed 15 years ago by jhi

Now it worked, thanks!

The libxml2 situation was:

libxml2 2.6.31_0 < 2.7.3_0

The outdated updating didn't upgrade the libxml2, but the forced updating did. And after that php5 configured, built, and installed fine.

No /usr/local/lib/libxml* files.

comment:7 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: invalid
Status: newclosed

I'm glad you got it working by upgrading to the current libxml2, though I'm distressed that MacPorts did not upgrade you to the latest version without forcing.

Note: See TracTickets for help on using tickets.