[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using Perl's cc
From: |
Eli Zaretskii |
Subject: |
Re: Using Perl's cc |
Date: |
Sat, 11 Jul 2015 18:32:32 +0300 |
> Date: Sat, 11 Jul 2015 15:04:57 +0100
> From: Gavin Smith <address@hidden>
> Cc: address@hidden
>
> 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
Yes, and then there's this in embed.h I have here:
#define pad_sv(a) Perl_pad_sv(aTHX_ a)
> If the pad_sv symbol isn't found, it's likely the headers aren't
> matching the libraries being used.
Unlikely: I even produced the library myself, using make_implib.pl,
and the result still didn't have Perl_pad_sv import in it.
> Another problem could be the command-line flags passed to the
> compiler: did you see anything like -DDEBUGGING when the files were
> being compiled?
Yes. Here's the full compilation command line:
/bin/sh ./libtool --tag=CC --mode=compile gcc -DPACKAGE_NAME=\"texinfo\"
-DPACKAGE_TARNAME=\"texinfo\" -DPACKAGE_VERSION=\"6.0\"
-DPACKAGE_STRING=\"texinfo\6.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\"
-DPACKAGE=\"texinfo\" -DVERSION=\"6.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1
-DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1
-DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1
-DLT_OBJDIR=\".libs/\" -I. -DPERL_USE_SAFE_PUTENV -DDEBUGGING
-DVERSION=\"6.0\" -DXS_VERSION=\"6.0\" "-I/d/usr/Perl/lib/CORE" -gdwarf-4 -g3
-O2 -MT mylib/XSParagraph_la-xspara.lo -MD -MP -MF
mylib/.deps/XSParagraph_la-xspara.Tpo -c -o mylib/XSParagraph_la-xspara.lo
`test -f 'mylib/xspara.c' || echo './'`mylib/xspara.c
libtool: compile: gcc -DPACKAGE_NAME=\"texinfo\"
-DPACKAGE_TARNAME=\"texinfo\" -DPACKAGE_VERSION=\"6.0\"
"-DPACKAGE_STRING=\"texinfo 6.0\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\"
-DPACKAGE=\"texinfo\" -DVERSION=\"6.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1
-DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1
-DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1
-DLT_OBJDIR=\".libs/\" -I. -DPERL_USE_SAFE_PUTENV -DDEBUGGING -DVERSION=\"6.0\"
-DXS_VERSION=\"6.0\" -I/d/usr/Perl/lib/CORE -gdwarf-4 -g3 -O2 -MT
mylib/XSParagraph_la-xspara.lo -MD -MP -MF
mylib/.deps/XSParagraph_la-xspara.Tpo -c mylib/xspara.c -DDLL_EXPORT -DPIC -o
mylib/.libs/XSParagraph_la-xspara.o
> 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.
Ah, you are right. For some reason, I thought you only take the -I
options from the ccflags configuration variable. So now I tried:
$ make PERL_INC=/d/usr/Perl/lib/CORE LDFLAGS='-no-undefined
-L/d/usr/Perl/lib/CORE -lperl520' PERL_CONF_ccflags='-DWIN32
-DPERL_TEXTMODE_SCRIPTS -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT
-DPERL_IMPLICIT_SYS -DUSE_PERLIO'
and got these compilation errors:
mylib/xspara.c: In function 'xspara_hello':
d:/usr/Perl/lib/CORE/perl.h:155:16: error: 'my_perl' undeclared (first use in
this function)
# define aTHX my_perl
^
d:/usr/Perl/lib/CORE/embedvar.h:38:18: note: in expansion of macro 'aTHX'
# define vTHX aTHX
^
d:/usr/Perl/lib/CORE/embedvar.h:58:19: note: in expansion of macro 'vTHX'
#define PL_Mem (vTHX->IMem)
^
d:/usr/Perl/lib/CORE/iperlsys.h:809:4: note: in expansion of macro 'PL_Mem'
(*PL_Mem->pMalloc)(PL_Mem, (size))
^
d:/usr/Perl/lib/CORE/XSUB.h:563:21: note: in expansion of macro
'PerlMem_malloc'
# define malloc PerlMem_malloc
^
mylib/xspara.c:225:17: note: in expansion of macro 'malloc'
utf8_locale = malloc (len + 6 + 1); /* enough to add ".UTF-8" to end */
^
d:/usr/Perl/lib/CORE/perl.h:155:16: note: each undeclared identifier is
reported only once for each function it appears in
# define aTHX my_perl
^
d:/usr/Perl/lib/CORE/embedvar.h:38:18: note: in expansion of macro 'aTHX'
# define vTHX aTHX
^
d:/usr/Perl/lib/CORE/embedvar.h:58:19: note: in expansion of macro 'vTHX'
#define PL_Mem (vTHX->IMem)
^
d:/usr/Perl/lib/CORE/iperlsys.h:809:4: note: in expansion of macro 'PL_Mem'
(*PL_Mem->pMalloc)(PL_Mem, (size))
^
d:/usr/Perl/lib/CORE/XSUB.h:563:21: note: in expansion of macro
'PerlMem_malloc'
# define malloc PerlMem_malloc
^
mylib/xspara.c:225:17: note: in expansion of macro 'malloc'
utf8_locale = malloc (len + 6 + 1); /* enough to add ".UTF-8" to end */
^
mylib/xspara.c: In function 'xspara_add_text':
d:/usr/Perl/lib/CORE/perl.h:155:16: error: 'my_perl' undeclared (first use in
this function)
# define aTHX my_perl
^
d:/usr/Perl/lib/CORE/embedvar.h:38:18: note: in expansion of macro 'aTHX'
# define vTHX aTHX
^
d:/usr/Perl/lib/CORE/embedvar.h:58:19: note: in expansion of macro 'vTHX'
#define PL_Mem (vTHX->IMem)
^
d:/usr/Perl/lib/CORE/iperlsys.h:813:4: note: in expansion of macro 'PL_Mem'
(*PL_Mem->pFree)(PL_Mem, (buf))
^
d:/usr/Perl/lib/CORE/XSUB.h:565:19: note: in expansion of macro 'PerlMem_free'
# define free PerlMem_free
^
mylib/xspara.c:902:31: note: in expansion of macro 'free'
free (new_space.text);
^
Makefile:455: recipe for target `mylib/XSParagraph_la-xspara.lo' failed
make[1]: *** [mylib/XSParagraph_la-xspara.lo] Error 1
Where should my_perl be defined?
For the record, the compilation flags are now as follows:
libtool: compile: gcc -DPACKAGE_NAME=\"texinfo\"
-DPACKAGE_TARNAME=\"texinfo\" -DPACKAGE_VERSION=\"6.0\"
"-DPACKAGE_STRING=\"texinfo 6.0\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\"
-DPACKAGE=\"texinfo\" -DVERSION=\"6.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1
-DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1
-DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1
-DLT_OBJDIR=\".libs/\" -I. -DWIN32 -DPERL_TEXTMODE_SCRIPTS -DUSE_SITECUSTOMIZE
-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DVERSION=\"6.0\"
-DXS_VERSION=\"6.0\" -I/d/usr/Perl/lib/CORE -gdwarf-4 -g3 -O2 -MT
mylib/XSParagraph_la-xspara.lo -MD -MP -MF
mylib/.deps/XSParagraph_la-xspara.Tpo -c mylib/xspara.c -DDLL_EXPORT -DPIC -o
mylib/.libs/XSParagraph_la-xspara.o
- Re: Using Perl's cc, (continued)
- Re: Using Perl's cc, Eli Zaretskii, 2015/07/05
- Re: Using Perl's cc, Gavin Smith, 2015/07/05
- Re: Using Perl's cc, Eli Zaretskii, 2015/07/05
- Re: Using Perl's cc, Gavin Smith, 2015/07/05
- Re: Using Perl's cc, Eli Zaretskii, 2015/07/05
- Re: Using Perl's cc, Eli Zaretskii, 2015/07/11
- Re: Using Perl's cc, Gavin Smith, 2015/07/11
- Re: Using Perl's cc,
Eli Zaretskii <=
- Re: Using Perl's cc, Gavin Smith, 2015/07/11
- Re: Using Perl's cc, Eli Zaretskii, 2015/07/11
- Re: Using Perl's cc, Gavin Smith, 2015/07/11
- Re: Using Perl's cc, Eli Zaretskii, 2015/07/11
- Re: Using Perl's cc, Eli Zaretskii, 2015/07/11
- Re: Using Perl's cc, Eli Zaretskii, 2015/07/11
- Re: Using Perl's cc, Gavin Smith, 2015/07/11
- Re: Using Perl's cc, Eli Zaretskii, 2015/07/11
- Re: Using Perl's cc, Gavin Smith, 2015/07/11
- Re: Using Perl's cc, Eli Zaretskii, 2015/07/11