Problem compiling cirus-imapd-2.2 (cvs 22042003)
Igor Brezac
igor at ypass.net
Thu Apr 24 13:42:07 EDT 2003
On Thu, 24 Apr 2003, Nikola Milutinovic wrote:
> Rob Siemborski wrote:
> > Okay, given the problems people are having with this I'm going to revert
> > the change.
> >
> > Nikola, if you could be more specific with what problems you were having
> > that would be helpful.
>
> OK, here goes.
>
> I have PERL-5.8.0: Threading: Multi-iThreads
>
Same here.
> I compiled Perl package for Cyrus and installed them, no obvious errors (some
> warnings on ptr type mismatch - "char *" and "const char *", but this is usual
> for most packages so far).
>
> When I tried to run "cyradm", I got an error. Perl complained on loading
> "IMAP.so" that there was an unresolved symbol "Perl_sv_setsv".
>
> The online docs for Perl mentioned that *that* function is retired and that
> "Perl_sv_setsv_flags" should be used instead. Compiling installing and running
> the same setup on Perl-5.6.1 went without a glitch (if I disregard my personal
> misunderstanding of SASL authentication, which was corrected by Ken Murchinson).
>
> So, I knew my installation of Perl-5.8.0 was to blame.
>
> Looking deeper into Perl docs, I found a note and confirmed it in *.h files of
> the Perl itself, that programmers are supposed to use macro "sv_setsv" instead
> of directly calling "Perl_sv_setsv*", since that macro will not change and will
> expand to what the actual version of Perl is using as API.
>
> When I changed "Perl_sv_setsv" to "sv_setsv" and compiled it on Perl-5.8.0,
> "cyradm" started working and correct function was being used.
>
> One other Perl fan (not of this list) commented that there is a "compatibility
> switch" ("PERLPOLUTE"?) when building Perl, so that it would still support old
> API. I havent found this while configuring Perl, but from the docs I'd gather
> that using iThreads would turn it on automatically.
>
What does "perl -V | grep 'Compile-time options'" say?
> The error that you guys are reporting is strange. "sv_setsv" is a macro which
> expects 3 parameters. "Perl_sv_setsv_flags" is a function which also expects 3
> arguments. How did you end up with 4 is beyond my understanding.
You are tripped up by the aTHX_ and pTHX_ macro definitions which define
whether the first parmater exits.
I suspect your perl is built without PERL_IMPLICIT_CONTEXT. If this
is the case Perl_sv_setsv_flags takes three parms, otherwise it takes four
params.
> Anyway, this patch is working on Cyrus 2.1.12 and Perl-5.8.0, as reported by one
> other member of this list. It would seam that 2.2-alpha is problematic.
No, both 2.1.12 and 2.2 are broken.
This patch should work for everyone:
--- IMAP.xs.orig Thu Apr 24 13:18:34 2003
+++ IMAP.xs Thu Apr 24 13:34:36 2003
@@ -294,7 +294,7 @@
/*FALLTHROUGH*/
default:
bang = perl_get_sv("^E", TRUE);
- Perl_sv_setiv(aTHX_ bang, rc);
+ sv_setiv(bang, rc);
XSRETURN_UNDEF;
}
ST(0) = sv_newmortal();
@@ -604,10 +604,10 @@
else
PUSHs(&sv_no);
pcb = perl_get_sv("@", TRUE);
- Perl_sv_setsv(aTHX_ pcb, av_shift(av));
+ sv_setsv(pcb, av_shift(av));
if (av_len(av) != -1) {
pcb = perl_get_sv("^E", TRUE);
- Perl_sv_setsv(aTHX_ pcb, av_shift(av));
+ sv_setsv(pcb, av_shift(av));
}
} else {
EXTEND(SP, av_len(av) + 1);
--
Igor
More information about the Info-cyrus
mailing list