Attached one more Q/A with Jan Dubois: (People who maintain notes on how to build vim with perl might want to update their notes based on this post.)
>Jan Dubois of ActiveState points out an issue with if_perl.xs: > >> The src/if_perl.xs file contains code to redefine all Perl >> functions it assumes it uses to wrapper names, and then looks >> up the real functions at runtime. That means that this file is >> specific to the Perl version used to compile it and will need >> to be updated for Perl 5.8.9. See for example: >> >> # if (PERL_REVISION == 5) && (PERL_VERSION >= 8) >> # define Perl_sv_2pv_flags dll_Perl_sv_2pv_flags >> # define Perl_sv_2pv_nolen dll_Perl_sv_2pv_nolen >> # else >> # define Perl_sv_2pv dll_Perl_sv_2pv >> # endif >> ... >> #if (PERL_REVISION == 5) && (PERL_VERSION >= 8) >> static char* (*Perl_sv_2pv_flags)(pTHX_ SV*, STRLEN*, I32); >> static char* (*Perl_sv_2pv_nolen)(pTHX_ SV*); >> #else >> static char* (*Perl_sv_2pv)(pTHX_ SV*, STRLEN*); >> #endif >> >> ... >> >> Similar code will be needed for sv_2iv_flags() and any other >> new symbol. >> >> It is a bit awkward to do this for ActivePerl 822, as it >> identifies itself as 5.8.8 because 5.8.9 has not been released >> yet, so we don't know which additional features will still be >> added. But internally AP822 is probably closer to what will be >> 5.8.9 than to 5.8.8. >> >> Anyways, the problem is that if_perl.xs is coupled pretty >> tightly to the Perl internals and needs updating whenever the >> internals change. I asked "Is there a better way to embed perl so as to be version independent?" The answer from Jan Dubois: > There really is no way to do it totally version independently. > One reason the vim code is so tightly coupled is that it doesn't > have an explicit reference to perl58.dll. Instead it calls > LoadLibrary() at runtime, and then GetProcAddress() to locate > all the imported symbols. This allows the same binary to be > used when there is no perl58.dll to be loaded. By linking > against perl58.lib your version will fail to load on a machine > that doesn't have Perl because you have now introduced a load > time dependency on perl58.dll. > > At the binary level, all Perl 5.8.x releases are backward > compatible in the sense that you can load a module compiled with > an earlier Perl version into a later Perl release. That means > you can build vim against Perl 5.8.0 and then use the vim binary > with perl58.dll from 5.8.9 or any other 5.8.x version. All new > versions continue to export the old symbols to support this > level of compatibility. > > Binary compatibility does not exist in the other direction: A > module compiled with Perl 5.8.8 may break under Perl 5.8.7. The > vim binary you built by linking explicitly against perl58.lib > from AP822 will not work with any earlier version of ActivePerl > or perl58.dll because they don't export the new symbols. > > This is also the reason we have to build all modules in the > ActivePerl PPM repositories against 5.8.0 [*]. That way they can > be used by any version of ActivePerl 8xx. > > [*] This is not strictly true anymore with AP819 and later using > PPM4, but we haven't yet managed to roll out the versioned > repository stuff at the server side. --Suresh --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---