php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59683 v8js.so: undefined symbol: _ZdlPv when build with static V8 library
Submitted: 2011-03-24 07:43 UTC Modified: 2015-03-13 14:55 UTC
From: planetphp at gmail dot com Assigned: stesie (profile)
Status: Closed Package: v8js (PECL)
PHP Version: 5.3.5 OS: Ubuntu 10.04
Private report: No CVE-ID: None
 [2011-03-24 07:43 UTC] planetphp at gmail dot com
Description:
------------
Built libv8-3.0 using scons. Compiled v8js.

For more information see 
http://stackoverflow.com/questions/5404518/google-v8-
javascript-engine-ubuntu-and-php-how-to-get-it-built-and-
working

Added the extension to php.ini and have the following in 
error.log:

PHP Startup: Unable to load dynamic library 
'/usr/lib/php5/20090626+lfs/v8js.so' - 
/usr/lib/php5/20090626+lfs/v8js.so: undefined symbol: _ZdlPv 
in Unknown on line 0

Expected result:
----------------
I expected it to work

Actual result:
--------------
PHP Startup: Unable to load dynamic library 
'/usr/lib/php5/20090626+lfs/v8js.so' - 
/usr/lib/php5/20090626+lfs/v8js.so: undefined symbol: _ZdlPv 
in Unknown on line 0

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-25 13:22 UTC] jani@php.net
You didn't mention what options you used when you build v8. Unfortunately I don't have any development env available for myself right now, but this source package worked fine for the latest release I made: 

http://pecl.php.net/~jani/v8-3.0.4-1.src.rpm

Also, that missing symbol sounds like something in libstdc++. You do have that around? Try 'ldd v8js.so' to see what libs it's linked with. It may be that you need to put the directory where libstdc++ is into /etc/ld.so.conf (or whatever it was again :)
 [2011-03-28 10:20 UTC] planetphp at gmail dot com
Thanks for your reply. I built libv8 using scons with no options.

I built v8js.so using the commands: phpize, ./configure, make.

The results of ldd are:
 ldd v8js.so
	linux-gate.so.1 =>  (0x001e7000)
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x005f5000)
	libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x00614000)
	/lib/ld-linux.so.2 (0x00f48000)

I have libstdc++6.4.4-dev, libstdc++5, libstdc++6 installed. I do not 
know what directory libstdc++ is in. There is a file called 
/etc/ld.so.conf and a folder called /etc/ld.so.conf.d/

What do I need to do?
 [2011-03-28 13:03 UTC] jani@php.net
You propably need to manually link v8js.so with libstdc++ since you didn't build V8 as shared. Building it as shared is better idea though..try that.
 [2011-03-29 05:02 UTC] planetphp at gmail dot com
I have now built v8 as shared and produced libv8.so which I 
have copied into /usr/lib. When I run make test on v8js I 
still get the error with the undefined symbol _ZdlPv. How 
would I manually link v8js.so with libstdc++?
 [2011-03-29 08:57 UTC] jani@php.net
Okay, now check what that libv8.so was linked with (ldd libv8.so) and same for the new v8js.so you created. Make sure you're loading the correct extension btw. I don't know why it doesn't work for you, it worked fine for me and couple of dozen others. I was using CentOS 5 though with that RPM I provided url to..
 [2011-03-29 11:29 UTC] planetphp at gmail dot com
Here is the results of ldd for both files:

ldd libv8.so
	linux-gate.so.1 =>  (0x00883000)
	libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0x00377000)
	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00110000)
	libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0x00206000)
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0022c000)
	libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x00e23000)
	/lib/ld-linux.so.2 (0x00dca000)



ldd v8js.so 
	linux-gate.so.1 =>  (0x003d6000)
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00504000)
	libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x006e4000)
	/lib/ld-linux.so.2 (0x00e4e000)

I tried to convert the rpm to a deb file using alien but it failed. I will try and setup a 
CentOS machine to build this on and will also try to build it on windows too. Thanks for your 
help.
 [2011-03-29 12:45 UTC] jani@php.net
Apparently that v8js.so still isn't linked with the shared libv8.so lib, did you remember to remove the static libv8.a before recompiling v8js?
 [2011-03-30 05:30 UTC] planetphp at gmail dot com
I had forgotten to remove libv8.a and once I had removed 
this, v8js successfully built! Thanks so much for your work 
and your help :)
 [2011-03-30 11:55 UTC] jani@php.net
Ok. I'll leave this report open as building v8js with static libv8 should work as well..
 [2015-03-13 14:55 UTC] stesie@php.net
-Status: Analyzed +Status: Closed -Assigned To: +Assigned To: stesie
 [2015-03-13 14:55 UTC] stesie@php.net
> Ok. I'll leave this report open as building v8js with static libv8 should work as well..

A dynamically linked PHP extension will never work if compiled against static (non-PIC) libv8; closing now.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Jan 20 12:01:23 2020 UTC