php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34089 Configure fails build test for libxml2
Submitted: 2005-08-12 04:53 UTC Modified: 2007-07-30 01:00 UTC
Votes:26
Avg. Score:4.1 ± 1.3
Reproduced:21 of 22 (95.5%)
Same Version:4 (19.0%)
Same OS:2 (9.5%)
From: ramsey@php.net Assigned:
Status: No Feedback Package: Compile Failure
PHP Version: 6CVS-2006-10-03 OS: Mac OS X 10.4.8
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ramsey@php.net
New email:
PHP Version: OS:

 

 [2005-08-12 04:53 UTC] ramsey@php.net
Description:
------------
Configure fails on the build test for libxml2 in HEAD, but the same configure line works fine when building PHP 5.1 on the same system. (I am trying to build according to Andrei's notes on building in the Unicode support: http://news.php.net/php.internals/17848 )

Had to include the options --disable-libxml, --disable-dom, and --disable-simplexml to get past the error. However, now I receive another error:

checking for char *... yes
checking size of char *... configure: error: cannot compute sizeof (char *), 77

But I should probably leave this error for another bug report once this one has been resolved (if it still exists once this is resolved).

Please see the output of config.log at http://benramsey.com/files/php/config.log

Reproduce code:
---------------
cvs -d :pserver:ramsey@cvs.php.net:/repository co -d php-HEAD php-src
cd php-HEAD

./buildconf
./configure --with-layout=PHP --prefix=/usr/local/php/6.0.0 --with-apxs=/usr/local/apache/83/bin/apxs --without-pear --with-sqlite --with-pdo-mysql=/usr/local/mysql --with-pdo-pgsql=/usr/local/pgsql --with-iconv=/sw --with-icu-dir=/usr/local/icu

Expected result:
----------------
I expect configure to run fine and generate the make files.

Actual result:
--------------
configure:29153: checking whether to enable LIBXML support
configure:29191: result: yes
configure:29200: checking libxml2 install dir
configure:29218: result: no
configure:29230: checking for xml2-config path
configure:29244: result: /usr/bin/xml2-config
configure:29387: checking whether libxml build works
configure:29419: gcc -o conftest -g -O2  -no-cpp-precomp  -L/usr/local/icu/lib -L/usr/local/icu/lib conftest.c 
          
         -lm  -lm -licui18n -licuuc -licudata -lm -licuio -lxml2 -lz -liconv -lm >&5
configure:29422: $? = 0
configure:29424: ./conftest
dyld: Library not loaded: libicui18n.dylib.34
  Referenced from: /Users/ramsey/src/php/php-HEAD/./conftest
  Reason: image not found
./configure: line 1: 16108 Trace/BPT trap          ./conftest$ac_exeext
configure:29427: $? = 133
configure: program exited with status 133

configure:29444: result: no
configure:29446: error: build test failed.  Please check the config.log for details.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-17 19:21 UTC] sniper@php.net
Does this work:

# ./configure --disable-all --with-icu-dir=/usr/local/icu

 [2005-08-17 20:21 UTC] ramsey@php.net
That configure line works.

I tried:
# ./configure --with-layout=PHP --prefix=/usr/local/php/6.0.0 --disable-all --with-icu-dir=/usr/local/icu
# make
# make install

All worked just fine, but now I'm getting a "Library not loaded" error.

ramsey:~ ramsey$ /usr/local/php/6.0.0/bin/php -m
dyld: Library not loaded: libicui18n.dylib.34
  Referenced from: /usr/local/php/6.0.0/bin/php
  Reason: image not found
Trace/BPT trap
 [2005-08-23 17:32 UTC] sniper@php.net
Try compiling the icu library yourself?

 [2005-08-23 20:18 UTC] ramsey@php.net
I did compile icu myself. I followed Andrei's instructions to download and build it. It compiled just fine without any problems.

Andrei's instructions are here:
http://news.php.net/php.internals/17848
 [2005-09-13 09:54 UTC] sniper@php.net
Try with newer icu release and latest CVS HEAD.


 [2005-09-15 23:20 UTC] ramsey@php.net
I grabbed the latest HEAD and I'm using the latest ICU (v3.4).

With the following config line, everything configures, makes, and make installs just fine:
./configure --with-layout=PHP --prefix=/usr/local/php/6.0.0 --disable-all --with-icu-dir=/usr/local/icu

However, I still receive an error:

ramsey:~ ramsey$ /usr/local/php/6.0.0/bin/php -i
dyld: Library not loaded: libicui18n.dylib.34
  Referenced from: /usr/local/php/6.0.0/bin/php
  Reason: image not found
Trace/BPT trap
 [2005-09-16 12:31 UTC] sniper@php.net
Can you reproduce this on some other Macosx machine?
Can someone else reproduce this?
 [2005-10-07 21:38 UTC] ramsey@php.net
I've just updated my checkout and tried to rebuild it. I'm still getting the "Library not loaded" errors, though.

I don't have access to another MacOSX machine. Is there someone else who can try to build this on their Mac to verify whether this issue can be reproduced?
 [2005-11-30 17:30 UTC] ramsey@php.net
Tried that CVS snapshot with the following config line:

./configure --with-layout=PHP --prefix=/usr/local/php/6.0.0 --disable-all --with-icu-dir=/usr/local/icu

It configures, makes, and make installs just fine.

But it still says the library isn't loaded:

ramsey:~ ramsey$ /usr/local/php/6.0.0/bin/php -v
dyld: Library not loaded: libicui18n.dylib.34
  Referenced from: /usr/local/php/6.0.0/bin/php
  Reason: image not found
Trace/BPT trap
 [2005-12-30 00:59 UTC] andrei@php.net
Do you actually have libicui18n.dylib.34 in /usr/local/...?
 [2006-01-14 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2006-01-31 23:04 UTC] kalowsky@php.net
OS X 10.4.2 - Build 8E90

PHP6 snapshot 200601311733

# ./configure --with-layout=PHP --prefix=/usr/local/php/6.0.0
--disable-all --with-icu-dir=/usr/local/icu
# make
# make install

Using gcc v4.0.1

Test script:
<? $a = "foo"; var_dump($a); ?>

php-cli -dunicode_semantics=on -f test.php

Result:
unicode(3) "foo"

Looks like the expected results to me.


Can you run "otool -L" on the php library and share that here?
 [2006-02-08 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2006-02-20 23:32 UTC] jeff at procata dot com
I have also encountered this problem.  To answer the 
first outstanding question, libicui18n.dylib.34 does 
exist in /usr/local/icu/lib.

I have not been successful in compiling with --disable-
all.  configure completes (configure: exit 0), but 
config.log still contains many cases of:

dyld: ./conftest can't open library: libicui18n.dylib.34  
(No such file or directory, errno = 2)
./configure: line 1:  2292 Trace/BPT trap          ./
conftest$ac_exeext

make fails with:

ld: Undefined symbols:
_lchown
 [2006-02-21 01:24 UTC] jeff at procata dot com
compiling this program as conftest.c:

main() { }

with the options generated in configure:

gcc -o conftest -g -O2  -no-cpp-precomp  -L/usr/local/
icu/lib -L/usr/local/icu/lib -L/usr/local/libxml2/lib 
-L/usr/local/libxml2/lib -lm  -lm -licui18n -licuuc 
-licudata -lm -licuio -lxml2 -lz -liconv -lm conftest.c

gives the following output from otool -L

conftest:        /usr/lib/libSystem.B.dylib 
(compatibility version 1.0.0, current version 71.1.4)
        libicui18n.dylib.34 (compatibility version 
34.0.0, current version 34.0.0)
        libicuuc.dylib.34 (compatibility version 34.0.0, 
current version 34.0.0)
        libicudata.dylib.34 (compatibility version 
34.0.0, current version 34.0.0)
        libicuio.dylib.34 (compatibility version 34.0.0, 
current version 34.0.0)
        /usr/local/libxml2/lib/libxml2.2.dylib 
(compatibility version 9.0.0, current version 9.22.0)
        /usr/lib/libz.1.dylib (compatibility version 
1.0.0, current version 1.0.0)
        /usr/lib/libiconv.2.dylib (compatibility version 
5.0.0, current version 5.0.0)

When executed fails with

dyld: ./conftest can't open library: libicui18n.dylib.34  
(No such file or directory, errno = 2)
Trace/BPT trap
 [2006-10-03 22:59 UTC] ramsey@php.net
So, the last time I tried this was about a year ago. I decided to try it again. Last time was with 6CVS-2005-10-17 and Mac OS X 10.4.2; now it's with 6CVS-2006-10-03 and Mac OS X 10.4.8.

I have ICU 3.6 installed at /usr/local/icu

I'm using the following configure line:

./configure --with-layout=PHP --prefix=/Users/ramsey/Documents/Projects/PHP/build --with-libxml-dir=/sw --with-icu-dir=/usr/local/icu

(Note that I'm using libxml 2.6.22, installed through Fink, so it's at /sw.)

When I run configure, I get the following error:

checking whether libxml build works... no
configure: error: build test failed.  Please check the config.log for details.

The config.log reveals the following:

configure:27084: checking for location of ICU headers and libraries
configure:27123: result: found in /usr/local/icu
configure:27126: checking for ICU 3.4 or greater
configure:27134: result: found 3.6
configure:27266: result: 
configure:27268: result: Configuring extensions
configure:27285: checking whether to enable LIBXML support
configure:27323: result: yes
configure:27332: checking libxml2 install dir
configure:27350: result: /sw
configure:27362: checking for xml2-config path
configure:27376: result: /sw/bin/xml2-config
configure:27519: checking whether libxml build works
configure:27551: gcc -o conftest -g -O2  -no-cpp-precomp  -L/usr/local/icu/lib -L/usr/local/icu/lib -L/sw/lib -L/sw/lib conftest.c 
          
         -lm  -lm -licui18n -licuuc -licudata -lm -licuio -lxml2 -lz -liconv -lm >&5
configure:27554: $? = 0
configure:27556: ./conftest
dyld: Library not loaded: libicui18n.dylib.36
  Referenced from: /Users/ramsey/Documents/Projects/PHP/php-src/./conftest
  Reason: image not found
./configure: line 1:  1070 Trace/BPT trap          ./conftest$ac_exeext
configure:27559: $? = 133
configure: program exited with status 133
configure: failed program was:
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define YYTEXT_POINTER 1
| #define BIND_8_COMPAT 1
| #define HAVE_SOCKLEN_T 1
| #define HAVE_SOCKADDR_UN_SUN_LEN 1
| #define PHP_WRITE_STDOUT 1
| #define HAVE_SENDMAIL 1
| #define HAVE_SOCKET 1
| #define HAVE_SOCKETPAIR 1
| #define HAVE_HTONL 1
| #define HAVE_GETHOSTNAME 1
| #define HAVE_GETHOSTBYADDR 1
| #define HAVE_YP_GET_DEFAULT_DOMAIN 1
| #define HAVE_DLOPEN 1
| #define HAVE_LIBDL 1
| #define HAVE_LIBM 1
| #define HAVE_RES_SEARCH 1
| #define HAVE_INET_ATON 1
| #define HAVE_DN_SKIPNAME 1
| #define STDC_HEADERS 1
| #define HAVE_DIRENT_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_DIRENT_H 1
| #define HAVE_APPLICATIONSERVICES_APPLICATIONSERVICES_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_NETINET_IN_H 1
| #define HAVE_ALLOCA_H 1
| #define HAVE_ARPA_INET_H 1
| #define HAVE_ARPA_NAMESER_H 1
| #define HAVE_ASSERT_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_GRP_H 1
| #define HAVE_LANGINFO_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_MONETARY_H 1
| #define HAVE_MACH_O_DYLD_H 1
| #define HAVE_NETDB_H 1
| #define HAVE_PWD_H 1
| #define HAVE_RESOLV_H 1
| #define HAVE_SIGNAL_H 1
| #define HAVE_STDARG_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_SYSLOG_H 1
| #define HAVE_SYSEXITS_H 1
| #define HAVE_SYS_IOCTL_H 1
| #define HAVE_SYS_FILE_H 1
| #define HAVE_SYS_MMAN_H 1
| #define HAVE_SYS_MOUNT_H 1
| #define HAVE_SYS_POLL_H 1
| #define HAVE_SYS_RESOURCE_H 1
| #define HAVE_SYS_SELECT_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_SYS_STATVFS_H 1
| #define HAVE_SYS_WAIT_H 1
| #define HAVE_TERMIOS_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_UTIME_H 1
| #define HAVE_SYS_UTSNAME_H 1
| #define HAVE_SYS_IPC_H 1
| #define HAVE_DLFCN_H 1
| #define HAVE_ASSERT_H 1
| #define HAVE_STRUCT_TM_TM_ZONE 1
| #define HAVE_TM_ZONE 1
| #define MISSING_FCLOSE_DECL 0
| #define HAVE_TM_GMTOFF 1
| #define HAVE_STRUCT_FLOCK 1
| #define HAVE_SOCKLEN_T 1
| #define SIZEOF_INTMAX_T 8
| #define SIZEOF_SIZE_T 4
| #define SIZEOF_SSIZE_T 4
| #define SIZEOF_PTRDIFF_T 4
| #define SIZEOF_LONG_LONG 8
| #define SIZEOF_LONG_LONG_INT 8
| #define SIZEOF_LONG 4
| #define SIZEOF_INT 4
| #define HAVE_SOCKADDR_STORAGE 1
| #define HAVE_SOCKADDR_SA_LEN 1
| #define HAVE_VPRINTF 1
| #define HAVE_ALPHASORT 1
| #define HAVE_ASCTIME_R 1
| #define HAVE_CHROOT 1
| #define HAVE_CTIME_R 1
| #define HAVE_CRYPT 1
| #define HAVE_FLOCK 1
| #define HAVE_FTOK 1
| #define HAVE_FUNOPEN 1
| #define HAVE_GAI_STRERROR 1
| #define HAVE_GCVT 1
| #define HAVE_GETLOADAVG 1
| #define HAVE_GETLOGIN 1
| #define HAVE_GETPROTOBYNAME 1
| #define HAVE_GETPROTOBYNUMBER 1
| #define HAVE_GETSERVBYNAME 1
| #define HAVE_GETSERVBYPORT 1
| #define HAVE_GETRUSAGE 1
| #define HAVE_GETTIMEOFDAY 1
| #define HAVE_GMTIME_R 1
| #define HAVE_GRANTPT 1
| #define HAVE_INET_NTOA 1
| #define HAVE_INET_NTOP 1
| #define HAVE_INET_PTON 1
| #define HAVE_ISASCII 1
| #define HAVE_LINK 1
| #define HAVE_LOCALTIME_R 1
| #define HAVE_LOCKF 1
| #define HAVE_LCHOWN 1
| #define HAVE_LRAND48 1
| #define HAVE_MEMCPY 1
| #define HAVE_MEMMOVE 1
| #define HAVE_MKSTEMP 1
| #define HAVE_MMAP 1
| #define HAVE_NL_LANGINFO 1
| #define HAVE_PERROR 1
| #define HAVE_POLL 1
| #define HAVE_PTSNAME 1
| #define HAVE_PUTENV 1
| #define HAVE_REALPATH 1
| #define HAVE_RANDOM 1
| #define HAVE_RAND_R 1
| #define HAVE_REGCOMP 1
| #define HAVE_RES_SEARCH 1
| #define HAVE_SCANDIR 1
| #define HAVE_SETITIMER 1
| #define HAVE_SETLOCALE 1
| #define HAVE_LOCALECONV 1
| #define HAVE_SETENV 1
| #define HAVE_SETPGID 1
| #define HAVE_SETSOCKOPT 1
| #define HAVE_SETVBUF 1
| #define HAVE_SHUTDOWN 1
| #define HAVE_SIN 1
| #define HAVE_SNPRINTF 1
| #define HAVE_SRAND48 1
| #define HAVE_SRANDOM 1
| #define HAVE_STATFS 1
| #define HAVE_STATVFS 1
| #define HAVE_STRCASECMP 1
| #define HAVE_STRCOLL 1
| #define HAVE_STRDUP 1
| #define HAVE_STRERROR 1
| #define HAVE_STRFTIME 1
| #define HAVE_STRPTIME 1
| #define HAVE_STRSTR 1
| #define HAVE_STRTOK_R 1
| #define HAVE_SYMLINK 1
| #define HAVE_TEMPNAM 1
| #define HAVE_TZSET 1
| #define HAVE_UNLOCKPT 1
| #define HAVE_UNSETENV 1
| #define HAVE_USLEEP 1
| #define HAVE_NANOSLEEP 1
| #define HAVE_UTIME 1
| #define HAVE_VSNPRINTF 1
| #define HAVE_GETADDRINFO 1
| #define HAVE_STRLCAT 1
| #define HAVE_STRLCPY 1
| #define HAVE_GETOPT 1
| #define HAVE_ALLOCA_H 1
| #define HAVE_ALLOCA 1
| #define HAVE_DECLARED_TIMEZONE 1
| #define HAVE_POSIX_READDIR_R 1
| #define PHP_SIGCHILD 0
| #define DEFAULT_SHORT_OPEN_TAG "1"
| #define HAVE_IPV6 1
| /* end confdefs.h.  */
| 
| 
|     char xmlInitParser();
|     int main() {
|       xmlInitParser();
|       return 0;
|     }
| 
configure:27576: result: no
configure:27578: error: build test failed.  Please check the config.log for details.

 [2006-10-03 23:31 UTC] ramsey@php.net
After an IRC conversation with Andrei, I recompiled ICU so that it did not have --prefix=/usr/local/icu in the configure line. This put ICU in a standard location. Then, I recompiled PHP with the following configure line:

./configure --prefix=/Users/ramsey/Documents/Projects/PHP/build --enable-debug --with-layout=PHP --without-mysql --disable-cgi --with-libxml-dir=/sw --with-zlib --disable-pdo --without-sqlite --enable-unicode

Configure, make, and make install went just fine.

Then, running "php6 -v" from the command line produced:
PHP 6.0.0-dev (cli) (built: Oct  3 2006 19:29:23) (DEBUG)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v3.0.0-dev, Copyright (c) 1998-2006 Zend Technologies

Perfect!

So, apparently, configure has a problem with finding ICU in a non-standard location, even in specifying --with-icu-dir.
 [2007-07-22 23:28 UTC] jani@php.net
Is this still a problem in latest HEAD?
 [2007-07-30 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2007-08-10 01:02 UTC] asokan dot anish at gmail dot com
I was using the configure script :

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --disable-debug --enable-inline-optimization --sysconfdir=/etc --with-png-dir=/usr --with-png --with-gettext --with-zlib --with-mysql=/usr/local/mysql --enable-ftp --enable-magic-quotes --enable-sockets --enable-track-vars --enable-trans-sid --enable-yp --enable-tidy --enable-wddx=shared --enable-mbstring --enable-mm=shared --enable-safe-mode --enable-xml --with-dom --with-libxml-dir=/usr --with-xml --with-gd=shared --with-regex=system --enable-dom --with-libxml-dir=/usr


I was also getting the same error.

But I installed, 3 rpm packages.

1] libxml2
2] libxml2-devel
3] zlib-devel

using the command

yum install libxml2 libxml2-devel

zlib-devel was automatically installed as a dependency.


After that the same configure script resolved the libxml error.

but I ended up in a different one!!


Configuring libtool
checking build system type... i686-pc-linux-gnu
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking how to recognise dependent libraries... pass_all
checking for object suffix... o
checking for executable suffix... no
checking for c++... no
checking for g++... no
checking for gcc... gcc
checking whether the C++ compiler (gcc   ) works... no
configure: error: installation or configuration problem: C++ compiler cannot create executables.

I think its something related with my compilers. Let me try another round of yum install...
 [2007-08-10 02:00 UTC] asokan dot anish at gmail dot com
I installed the gcc-c++ binaries and its dependencies.

using yum install gcc-c++.i386 gcc-libstc++

though there were some 5 more depended files.

The error:

configure: error: installation or configuration problem: C++ compiler
cannot create executables.

was resolved.

and I the configuration script sucessfully completed!

I was able to install php 5.2.3 with apache httpd-2.2.4, mysql-5.0.45, libxml2-2.6.29, zlib-1.2.3, libpng-1.2.18, gd-2.0.35 etc.

Anish Asokan
 [2008-05-08 21:11 UTC] marcioandreyfurtado at hotmail dot com
yes
 [2008-05-19 06:06 UTC] steve_d at redmonkey dot org
I've just ran into this problem building on MAC with the latest (at time of writting this) PHP6 snapshot from snaps.php.net.

The issue in my case was related to the icu libraries rather than any problem with PHP's configure.

The icu build system produces MAC platform libraries with an install name which does not include a path, this can be seen by running "otool -L" on any of the libraries or anything you build that links against any of the libraries.

So, PHP6's configure fails when executing libxml2's conftest if icu's libraries are installed in a directory not included in dyld's search path as dyld quite simply has no idea where else to look for the libraries.

You could get round the problem by installing the icu libraries in a path already searched for by dyld or adding the path to the libraries to the "DYLD_LIBRARY_PATH" environment variable. 

My solution was to edit icu's darwin config file found at "<icu-source-directory>/config/mh-darwin" 

By changing line 28 from:

LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(notdir $(MIDDLE_SO_TARGET))

To:

LD_SONAME = -Wl,-compatibility_version -Wl,$(SO_TARGET_VERSION_MAJOR) -Wl,-current_version -Wl,$(SO_TARGET_VERSION) -install_name $(libdir)/$(notdir $(MIDDLE_SO_TARGET))
 
And all appears to be good, for me at least. Hopefully some of that will help.
 [2008-10-20 11:06 UTC] boydjd at jbip dot net
I've tested this with OS X 10.5.5 and CVS HEAD tonight, and upon installing ICU following the last commenter's suggestions, ./configure and make when just fine with no errors.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 07:01:27 2024 UTC