In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/50fd59617d035069f1af09e538c403b3e05768b3?hp=108cd9378f43400cd4512da34871a49893a6f53d>
- Log ----------------------------------------------------------------- commit 50fd59617d035069f1af09e538c403b3e05768b3 Author: Jan Dubois <[email protected]> Date: Mon Oct 18 15:56:04 2010 -0700 Don't use "dllimport" for code in perl5xx.dll This makes a difference for extensions that are "statically" linked into the Perl library, like DynaLoader and Win32CORE. The MinGW compiler/linker cannot resolve symbols that have been annotated as "dllimport" but are actually defined inside the same library. An exception is needed for the ext/re extension, which redefines core APIs internally, so these functions must not be marked as "dllimport" either. This commit is a fix/enhancement to commit ad6ab6c5. ----------------------------------------------------------------------- Summary of changes: win32/win32.h | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/win32/win32.h b/win32/win32.h index a7e3e12..c8fd493 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -55,7 +55,16 @@ #define DllExport __declspec(dllimport) #endif -#ifndef PERL_CORE +/* The Perl APIs can only be called directly inside the perl5xx.dll. + * All other code has to import them. By declaring them as "dllimport" + * we tell the compiler to generate an indirect call instruction and + * avoid redirection through a call thunk. + * + * The XS code in the re extension is special, in that it redefines + * core APIs locally, so don't mark them as "dllimport" because GCC + * cannot handle this situation. + */ +#if !defined(PERLDLL) && !defined(PERL_EXT_RE_BUILD) # ifdef __cplusplus # define PERL_CALLCONV extern "C" __declspec(dllimport) # else -- Perl5 Master Repository
