Does Perl 5.8.0 contain symbol Perl_sv_2pv?

D

DirtyBear

Hi friends,

Perl 5.8.0 seems a bit strange. I encounterred a trouble in my dynamic
library which uses this symbol of Perl:
ld.so.1: perl: fatal: relocation error: file /opt/mylib/libAPIPerl.so:
symbol Perl_sv_2pv: referenced symbol not found
Killed

Solaris 9/10
Perl was built from source code tar ball.

zcyds4d6-85> perl -v
This is perl, v5.8.0 built for sun4-solaris-64int
zcyds4d6-89> nm /bin/perl | grep -i Perl_sv_2pv
[2590] | 597800| 2980|FUNC |GLOB |0 |11 |
Perl_sv_2pv_flags
[2234] | 597504| 28|FUNC |GLOB |0 |11 |
Perl_sv_2pv_nolen
[2106] | 601164| 76|FUNC |GLOB |0 |11 |Perl_sv_2pvbyte
[921] | 601140| 24|FUNC |GLOB |0 |11 |
Perl_sv_2pvbyte_nolen
[1338] | 601264| 76|FUNC |GLOB |0 |11 |Perl_sv_2pvutf8
[1487] | 601240| 24|FUNC |GLOB |0 |11 |
Perl_sv_2pvutf8_nolen

But from perl5.6.1 to perl 5.8.8, I can find the reference in every
release except 5.8.0.
Perl5.8.4 sample:
nm /usr/local/bin/perl | grep -i Perl_sv_2pv
[1926] | 596152| 28|FUNC |GLOB |0 |9 |Perl_sv_2pv
[1540] | 596180| 2872|FUNC |GLOB |0 |9 |
Perl_sv_2pv_flags
[1677] | 595996| 28|FUNC |GLOB |0 |9 |
Perl_sv_2pv_nolen
[2571] | 599204| 132|FUNC |GLOB |0 |9 |Perl_sv_2pvbyte
[2454] | 599180| 24|FUNC |GLOB |0 |9 |
Perl_sv_2pvbyte_nolen
[2084] | 599360| 132|FUNC |GLOB |0 |9 |Perl_sv_2pvutf8
[2450] | 599336| 24|FUNC |GLOB |0 |9 |
Perl_sv_2pvutf8_nolen


The Perl 5.8.0 delta ( http://search.cpan.org/dist/perl/pod/perl58delta.pod#Perl_get_sv
) said that it that is no more the case. what does it mean?
Perl_get_sv
You may get errors like 'Undefined symbol "Perl_get_sv"' or "can't
resolve symbol 'Perl_get_sv'", or the symbol may be "Perl_sv_2pv".
This probably means that you are trying to use an older shared Perl
library (or extensions linked with such) with Perl 5.8.0 executable.
Perl used to have such a subroutine, but that is no more the case.
Check your shared library path, and any shared Perl libraries in those
directories.

Sometimes this problem may also indicate a partial Perl 5.8.0
installation, see "Mac OS X dyld undefined symbols"

I also found a link about this issue, but it did not say whether this
symbol was kept in Perl 5.8.0.
http://www.gossamer-threads.com/lists/engine?do=post_view_printable;post=6902;list=modperl

Why is Perl 5.8.0 so strange? How to resolve this problem?

Thanks in advance.
 
B

Ben Bullock

Why is Perl 5.8.0 so strange? How to resolve this problem?

Perhaps I'm making a stupid comment, because possibly you know that Perl
is now on 5.10 and the 5.8 version of Perl is at version 5.8.8. I know
that 5.8.0 had some bugs in it. If you want to build Perl from source, it
might be a wise idea to build a more recent version.
 
S

sisyphus

Hi friends,

Perl 5.8.0 seems a bit strange. I encounterred a trouble in my dynamic
library which uses this symbol of Perl:
ld.so.1: perl: fatal: relocation error: file /opt/mylib/libAPIPerl.so:
symbol Perl_sv_2pv: referenced symbol not found .
.
Why is Perl 5.8.0 so strange? How to resolve this problem?

I find the same thing on Win32. Seems that Perl_sv_2pv was removed for
perl 5.8.0, and then reinstated for subsequent builds. (I don't know
why.)
If you need to have your code work on perl 5.8.0 then one way would be
to use something other than Perl_sv_2pv to do the job.

The perl 5.8.8 source file sv.h contains:

#define sv_2pv(sv, lp) sv_2pv_flags(sv, lp, SV_GMAGIC)

So you may just need to replace all of your "sv_2pv(sv, lp)" calls
with "sv_2pv_flags(sv, lp, SV_GMAGIC)". That's assuming that
sv_2pv_flags exists throughout the full range of perl versions that
you need to support. (I haven't checked to see whether that's the
case.)

Cheers,
Rob
 
B

Ben Morrow

Quoth DirtyBear said:
Perl 5.8.0 seems a bit strange. I encounterred a trouble in my dynamic
library which uses this symbol of Perl:
ld.so.1: perl: fatal: relocation error: file /opt/mylib/libAPIPerl.so:
symbol Perl_sv_2pv: referenced symbol not found
Killed
But from perl5.6.1 to perl 5.8.8, I can find the reference in every
release except 5.8.0.

From perl581delta:

| APIs obsoleted in Perl 5.8.0, like sv_2pv, sv_catpvn, sv_catsv,
| sv_setsv, are again available.

So it seems that removing these entry points, like a number of other
changes made in 5.8.0, was considered a bad idea and reverted for 5.8.1.
5.8.0 is well known to be quite buggy; it's a bad idea to use it. Unless
you have a strong reason not to, you should be using 5.8.8; otherwise,
use 5.8.1.

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top