murisfurder / vim

Automatically exported from code.google.com/p/vim
0 stars 0 forks source link

Support for Activestate perl 5.18.1.1800 on windows #170

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Please, add support for Activestate perl 5.18.1.1800 on windows.

Building vim v7-4-045 from sources with perl support:

mingw32-make.exe -f Make_ming.mak ARCH=x86-64 FEATURES=HUGE OLE=yes 
PERL="d:/utils/perl" PERL_VER=518 DYNAMIC_PERL=yes gvim.exe xxd/xxd.exe 
vimrun.exe

produce following errors:

gobjx86-64/if_perl.o:if_perl.c:(.text+0xad8): undefined reference to 
`__imp_Perl_croak_xs_usage'
gobjx86-64/if_perl.o:if_perl.c:(.text+0xca8): undefined reference to 
`__imp_Perl_croak_xs_usage'
gobjx86-64/if_perl.o:if_perl.c:(.text+0xefb): undefined reference to 
`__imp_Perl_croak_xs_usage'
gobjx86-64/if_perl.o:if_perl.c:(.text+0x1058): undefined reference to 
`__imp_Perl_croak_xs_usage'
gobjx86-64/if_perl.o:if_perl.c:(.text+0x139b): undefined reference to 
`__imp_Perl_croak_xs_usage'
gobjx86-64/if_perl.o:if_perl.c:(.text+0x16ee): more undefined references to 
`__imp_Perl_croak_xs_usage' follow
gobjx86-64/if_perl.o:if_perl.c:(.text+0x3968): undefined reference to 
`__imp_Perl_sv_free2'
gobjx86-64/if_perl.o:if_perl.c:(.text+0x3d48): undefined reference to 
`__imp_Perl_sv_free2'
d:/utils/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mi
ngw32/bin/ld.exe: gobjx86-64/if_perl.o: bad reloc address 0x
20 in section `.data'
collect2.exe: error: ld returned 1 exit status
Make_ming.mak:691: recipe for target 'gvim.exe' failed
mingw32-make.exe: *** [gvim.exe] Error 1

I use:
- windows 8 x64;
- activestate perl 5.18.1.1800 x64;
- MinGW-builds x64-4.8.1-release-posix-seh-rev5;

Original issue reported on code.google.com by z...@softvisio.net on 1 Oct 2013 at 8:27

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
The modification of if_perl.xs to work around.

1. Perl_sv_free2:
  Perl 5.18.1 introduces a new file lib\CORE\inline.h, which defines inline functions that refers to Perl_sv_free2 before if_perl.xs defines Perl_sv_free2.
  Perl_sv_free2 must be defined before inline.h uses it.
  Define macro PERL_NO_INLINE_FUNCTIONS before #include "vim.h" to prevent perl.h to include inline.h.
  After Perl_sv_free2 is defined, include "inline.h" manual to retrieve the definitions of S_SvREFCNT_inc and S_SvREFCNT_dec.
  Another issue is, Perl_sv_free2 has 2 arguments now, the definition becomes "static void (*Perl_sv_free2)(pTHX_ SV*, const U32);".

2. Perl_croak_xs_usage:
  In lib\CORE\embed.h, macro croak_xs_usage is defined as "#define croak_xs_usage    Perl_croak_xs_usage".
  However, in the generated if_perl.c, croak_xs_usage should be defined as "#define croak_xs_usage S_croak_xs_usage".
  Thus, undefine macro croak_xs_usage, and undefine macro PERL_ARGS_ASSERT_CROAK_XS_USAGE to enable "#define croak_xs_usage S_croak_xs_usage".

I use:
- Window 7 Home Basic x64.
- Visual C++ 2012 Express for Desktop SP1 x86.
- Perl 5.18.1 x86 built from source: 
http://www.cpan.org/src/5.0/perl-5.18.1.tar.gz.

Original comment by Gauchy...@gmail.com on 16 Oct 2013 at 2:56

Attachments:

GoogleCodeExporter commented 9 years ago
Unfortunately this patch does not work with Activestate perl 5.18.1 x64.
Part of error log:

if_perl.c:1916:15: note: in expansion of macro 'newXSproto_portable'
         (void)newXSproto_portable("VIBUF::Get", XS_VIBUF_Get, file, "$;@");
               ^
if_perl.c:1137:67: error: expected expression before ')' token
 #define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
                                                                   ^
if_perl.c:1917:15: note: in expansion of macro 'newXSproto_portable'
         (void)newXSproto_portable("VIBUF::Set", XS_VIBUF_Set, file, "$;@");
               ^
if_perl.c:1137:66: error: invalid operands to binary * (have 'struct 
<anonymous> *' and 'struct <anonymous> *')
 #define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
                                                                  ^
if_perl.c:1917:15: note: in expansion of macro 'newXSproto_portable'
         (void)newXSproto_portable("VIBUF::Set", XS_VIBUF_Set, file, "$;@");
               ^
if_perl.c:1137:67: error: expected expression before ')' token
 #define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
                                                                   ^
if_perl.c:1918:15: note: in expansion of macro 'newXSproto_portable'
         (void)newXSproto_portable("VIBUF::Delete", XS_VIBUF_Delete, file, "$;@");
               ^
if_perl.c:1137:66: error: invalid operands to binary * (have 'struct 
<anonymous> *' and 'struct <anonymous> *')
 #define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
                                                                  ^
if_perl.c:1918:15: note: in expansion of macro 'newXSproto_portable'
         (void)newXSproto_portable("VIBUF::Delete", XS_VIBUF_Delete, file, "$;@");
               ^
if_perl.c:1137:67: error: expected expression before ')' token
 #define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
                                                                   ^
if_perl.c:1919:15: note: in expansion of macro 'newXSproto_portable'
         (void)newXSproto_portable("VIBUF::Append", XS_VIBUF_Append, file, "$;@");
               ^
if_perl.c:1137:66: error: invalid operands to binary * (have 'struct 
<anonymous> *' and 'struct <anonymous> *')
 #define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
                                                                  ^
if_perl.c:1919:15: note: in expansion of macro 'newXSproto_portable'
         (void)newXSproto_portable("VIBUF::Append", XS_VIBUF_Append, file, "$;@");
               ^
if_perl.c:1924:5: error: 'XSRETURN_YES' undeclared (first use in this function)
     XSRETURN_YES;
     ^
Make_ming.mak:734: recipe for target 'gobjx86-64/if_perl.o' failed
mingw32-make.exe: *** [gobjx86-64/if_perl.o] Error 1

Original comment by alaska...@gmail.com on 16 Oct 2013 at 3:45

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Sorry, I've forgot to mention that I was building vim-7.3.1314. :P

vim-7.4 has a different vim.h, which doesn't include "perl.h" anymore, and the 
if_perl.xs is changed accordingly.
That's why a vim-7.3.1314 "if_perl.xs" doesn't work (some definitions from perl 
are missing).

I've attached the modified "if_perl.xs" from revision 5404, which should work 
for both 7.3 and 7.4 versions.

OK to build under Visual C++ 2012.
I didn't test it with mingw32, however.

Original comment by Gauchy...@gmail.com on 17 Oct 2013 at 3:27

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks, now works without any errors. 
Built and tested vim 7.4 with mingw-x64 and ActivePerl 5.18.1.

Original comment by z...@softvisio.net on 17 Oct 2013 at 6:45

GoogleCodeExporter commented 9 years ago
Hi,

windows 8.1 x64
vim 7.4.155
strawberry perl 5.18.2.1 x64
MinGW-builds toolchain, x64-4.8.1-release-posix-seh-rev5

Compiling vim with following cmd:

mingw32-make.exe -f Make_ming.mak ARCH=x86-64 FEATURES=HUGE OLE=yes 
PERL="d:/devel/perl" PERL_VER=518 DYNAMIC_PERL=yes gvim.exe xxd/xxd.exe 
vimrun.exe

Vim compiled successfully, but when i trying to use perl inside vim - got error:

E370: Could not load library perl518.dll
Sorry, this command is disabled: the Perl library could not be loaded.

Perl bin directory is in the %path%, also, with ActivePerl 5.18.1 x64 
everything works fine.

Please, help to resolve this problem.

Original comment by dzagas...@gmail.com on 19 Jan 2014 at 4:39

GoogleCodeExporter commented 9 years ago
The original issue was already fixed with 7.4.117, 120, 127 and 128.
Maybe this issue can be closed.

> #7 dzagas...@gmail.com

There are some fixes for if_perl after 7.4.155.
(E.g. 7.4.321 supports Strawberry Perl 5.20.)
Does it still occur with the latest Vim?

Original comment by ktakata6...@gmail.com on 14 Nov 2014 at 4:33

GoogleCodeExporter commented 9 years ago
Okay, closing as fixed then.

Original comment by chrisbr...@googlemail.com on 15 Nov 2014 at 12:29