texinfo-devel
[Top][All Lists]
Advanced

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

Re: Using Perl's cc


From: Gavin Smith
Subject: Re: Using Perl's cc
Date: Sat, 11 Jul 2015 15:04:57 +0100

On 11 July 2015 at 14:10, Eli Zaretskii <address@hidden> wrote:
> This still fails to build the shared library, with these error
> messages:
>
>   libtool: link: gcc -shared  .libs/XSParagraph_la-XSParagraph.o 
> mylib/.libs/XSParagraph_la-xspara.o mylib/.libs/XSParagraph_la-text.o   
> -L/d/usr/Perl/lib/CORE -lperl520  -O2   -o .libs/XSParagraph-0.dll 
> -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker 
> .libs/XSParagraph.dll.a
>   .libs/XSParagraph_la-XSParagraph.o: In function 
> `XS_XSParagraph_end_line_count':
>   d:\gnu\svn\texinfo\trunk\tp\Texinfo\Convert\XSParagraph/XSParagraph.c:125: 
> undefined reference to `_imp__Perl_pad_sv'
>   .libs/XSParagraph_la-XSParagraph.o: In function `XS_XSParagraph_end_line':
>   d:\gnu\svn\texinfo\trunk\tp\Texinfo\Convert\XSParagraph/XSParagraph.c:174: 
> undefined reference to `_imp__Perl_pad_sv'
>   .libs/XSParagraph_la-XSParagraph.o: In function 
> `XS_XSParagraph_get_pending':
>   d:\gnu\svn\texinfo\trunk\tp\Texinfo\Convert\XSParagraph/XSParagraph.c:200: 
> undefined reference to `_imp__Perl_pad_sv'
>   .libs/XSParagraph_la-XSParagraph.o: In function 
> `XS_XSParagraph_set_space_protection':
>   d:\gnu\svn\texinfo\trunk\tp\Texinfo\Convert\XSParagraph/XSParagraph.c:462: 
> undefined reference to `_imp__Perl_pad_sv'
>   mylib/.libs/XSParagraph_la-text.o: In function `text_printf':
>   d:\gnu\svn\texinfo\trunk\tp\Texinfo\Convert\XSParagraph/mylib/text.c:34: 
> undefined reference to `vasprintf'
>   collect2.exe: error: ld returned 1 exit status
>   Makefile:407: recipe for target `XSParagraph.la' failed
>   make[1]: *** [XSParagraph.la] Error 1
>
> The issue with vasprintf is clear (how do I solve it?), but
> `_imp__Perl_pad_sv' is the import symbol corresponding to Perl_pad_sv
> function, which is not found in the import library libperl520.a
> distributed with my Perl.  I have no idea what that means (perhaps a
> bug in the version of Perl I have? or maybe this function), and couldn't find 
> anything on the
> net to help me resolve this issue.
>
> Is there perhaps a way to avoid calling Perl_pad_sv?  They all come
> from lines like this:
>
>         dXSTARG;
>
> What does that do?

dXSTARG appears in XSParagraph.c, which is generated from
XSParagraph.xs by xsubpp. On my system, dXSTARG is defined in
/usr/lib/perl5/CORE/XSUB.h with

#define dXSTARG SV * const targ = ((PL_op->op_private & OPpENTERSUB_HASTARG) \
                             ? PAD_SV(PL_op->op_targ) : sv_newmortal())

There is some documentation of what dXSTARG is for in "man perlapi",
but hopefully we won't have to understand it.

PAD_SV in turn is defined in /usr/lib/perl5/CORE/pad.h:

#ifdef DEBUGGING
#  define PAD_SV(po)       pad_sv(po)
#  define PAD_SETSV(po,sv) pad_setsv(po,sv)
#else
#  define PAD_SV(po)       (PL_curpad[po])
#  define PAD_SETSV(po,sv) PL_curpad[po] = (sv)
#endif

If the pad_sv symbol isn't found, it's likely the headers aren't
matching the libraries being used. Another problem could be the
command-line flags passed to the compiler: did you see anything like
-DDEBUGGING when the files were being compiled?

The fact you had to override PERL_INC suggests that the compiler flags
should also have been overridden (e.g. use the right installed Perl in
the fetch_conf.pl script), but might not have been.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]