[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Net::SAML doesn't compile with perl 5.20 on FreeBSD 10.0

Mike Kuznetsov <mike.kuznetsov@xxxxxxxxxxxxx> said:
> Hi Sampo,
> I tried to join the mailing list, but mailbot said i can't join it without
> somebody's (yours i suppose) manual permission, so i'm writing to you
> directly.

You have been added to the list. Sorry for the delay.

> I've been trying to build Net::SAML on FreeBSD 10.0 with perl 5.20, but
> compilation fails. I tried to install it from ports, from CPAN and from
> sources (1.18, 1.22 and from git). Some issues could be fixed with little
> hacks, except this one. What should i try to do? Thanks in advance.
> --- SAML_wrap.o ---
> SAML_wrap.c:1620:6: error: use of undeclared identifier 'bool'
>      SvSetSV(tmp, obj);
>      ^
> /usr/local/lib/perl5/5.20/mach/CORE/sv.h:2080:3: note: expanded from macro
> 'SvSetSV'
>                 SvSetSV_and(dst,src,/*nothing*/;)
>                 ^
> /usr/local/lib/perl5/5.20/mach/CORE/sv.h:2066:10: note: expanded from macro
> 'SvSetSV_and'
>             if (LIKELY((dst) != (src))) {               \
>                 ^
> /usr/local/lib/perl5/5.20/mach/CORE/perl.h:3151:52: note: expanded from
> macro 'LIKELY'
> #define LIKELY(cond)                        EXPECT(cBOOL(cond),TRUE)
>                                                    ^
> /usr/local/lib/perl5/5.20/mach/CORE/handy.h:124:34: note: expanded from
> macro 'cBOOL'
> #define cBOOL(cbool) ((cbool) ? (bool)1 : (bool)0)
>                                  ^

The LIKELY() and cBOOL() macros are innovations of perl 5.20.
I checked the sources of perl 5.18.2 and there the macro
definition is much more straight forward and does not
reference bool. I can confirm that there is no compilation
problem with perl 5.18.2.

In all likelyhood this bool macro or typedef can be found in
some header that comes with your new perl. Find that
header and make sure it gets included, e.g.

grep -r '\#\s*define\s+bool' /usr/local/lib/perl5/5.20
grep -r 'typedef.*?bool;' /usr/local/lib/perl5/5.20

In a pinch, you could try adding definition of bool yourself,
e.g. #define bool (int)

SWIG tool that was used to generate SAML_wrap.c is
several years old so it may not be aware of backwards
incompatible changes in perl extension API and thus
does not understand that some additional file is supposed
to be included. It is also possible that the perl
developers screwed up and added a dependency on new
include file without realizing it themselves. Thus this
may also be a perl bug worth reporting.


> /usr/local/lib/perl5/5.20/mach/CORE/perl.h:3147:62: note: expanded from
> macro 'EXPECT'
> #  define EXPECT(expr,val)                  __builtin_expect(expr,val)
>                                                              ^
> SAML_wrap.c:1620:6: error: expected ':'
> /usr/local/lib/perl5/5.20/mach/CORE/sv.h:2080:3: note: expanded from macro
> 'SvSetSV'
>                 SvSetSV_and(dst,src,/*nothing*/;)
>                 ^
(snipped tons of similar errors)
> fatal error: too many errors emitted, stopping now [-ferror-limit=]
> 6 warnings and 20 errors generated.
> *** [SAML_wrap.o] Error code 1
> make[1]: stopped in /tmp/usr/ports/security/p5-Net-SAML/work/zxid-1.18/Net
> 1 error
> make[1]: stopped in /tmp/usr/ports/security/p5-Net-SAML/work/zxid-1.18/Net