Edit report at https://bugs.php.net/bug.php?id=44294&edit=1

 ID:                 44294
 Comment by:         jmlane at gmail dot com
 Reported by:        danval at gmail dot com
 Summary:            Undefined symbols with libxml2
 Status:             No Feedback
 Type:               Bug
 Package:            Compile Failure
 Operating System:   Mac 10.5 Leopard Client
 PHP Version:        5.*, 6CVS (2009-07-09)
 Assigned To:        fb-req-jani
 Block user comment: N
 Private report:     N

 New Comment:

Issue still exists in 5.x trunk from SVN.

The solution is simple: in the Makefile, on the line where 
"libs/libphp$(PHP_MAJOR_VERSION).bundle:" appears, the $(MH_BUNDLE_FLAGS) 
variable should be called after "$(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) 
$(EXTRA_LDFLAGS)" so that the hard-coded "/usr/lib" search path is searched 
after any user-provided search paths given during configure.

For example, the Makefile currently contains this passage:

"MH_BUNDLE_FLAGS = -bundle -bundle_loader /usr/sbin/httpd -L/usr/lib -L/usr/lib 
-laprutil-1 -lsqlite3 -lexpat -liconv -L/usr/lib -lapr-1 -lpthread"

...which sets library search paths as '/usr/lib'.

Further below:

"libs/libphp$(PHP_MAJOR_VERSION).bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
        $(CC) $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) 
$(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) 
$(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ 
libs/libphp$(PHP_MAJOR_VERSION).so"

...demonstrates that the '-L/usr/lib' from $MH_BUNDLE_FLAGS is given priority 
and will be searched before the '-L/custom/paths' contained in the variables 
immediately following it. This is likely not the intended behaviour, since it 
circumvents the user's intentions when passing library search paths to the 
configure script.

What should be found in the Makefile—which will resolve this issue—is the 
following:

"libs/libphp$(PHP_MAJOR_VERSION).bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
        $(CC) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) 
$(MH_BUNDLE_FLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) 
$(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ 
libs/libphp$(PHP_MAJOR_VERSION).so"

Can anyone with autotools and PHP build process familiarity comment on any 
possible repercussions from this minor and logical change?


Previous Comments:
------------------------------------------------------------------------
[2009-07-18 23:20:06] rdohms at gmail dot com

Jani.

Adding /lib was the only way i got it working.. otherwise it skipped those dirs 
and kep hamerring /usr/lib which is the next in line, like here:

cc -bundle -bundle_loader /Applications/Server/Apache2/bin/httpd  -L/usr/lib 
-L/usr/lib -laprutil-1...

What i have been doing to compile succesfully is altering to this

cc -bundle -bundle_loader /Applications/Server/Apache2/bin/httpd -L/opt/xml/lib 
-L/opt/local/lib -L/usr/lib -L/usr/lib -laprutil-1...

This was gwyne's suggestion and it works great.

After I enabled OpenSSL i got evem more of these, hence the /opt/local/lib i 
also placed there.

As for versions, i have reproduced these today on:
PHP_5_3, PHP_5_2 and trunk, straight from SVN


I'm rdohms on php.pecl if you want to chat about this

------------------------------------------------------------------------
[2009-07-17 01:00:00] 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".

------------------------------------------------------------------------
[2009-07-09 20:43:44] j...@php.net

And if you change the version, add a note about it. Now there's no way 
to know what version you reported this with, what version it works 
with..etc.

------------------------------------------------------------------------
[2009-07-09 20:41:49] j...@php.net

Remove the /lib from those paths. "rdohms at gmail dot com":  Where did 
you get the idea it's okay to pass that anywhere?!

------------------------------------------------------------------------
[2009-06-22 13:49:51] rdohms at gmail dot com

actualy sorry.

I had --with-libxml-dir declared.
Tried running it with --enable-xmlreader-/opt/xml/lib, just like the above 
setting and it broke on the same place as before.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=44294


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=44294&edit=1

Reply via email to