On 27/04/2012 23:26, Marvin Humphrey wrote:
On Fri, Apr 27, 2012 at 10:13 AM, Nick Wellnhofer<[email protected]> wrote:
The WhitespaceTokenizer extension works on ActivePerl/MSVC but we'll have to
keep using cf_linker_flags. This will also be the case for other Perls on
Windows, since the dynamic linker is part of the OS.
So I propose we switch to DynaLoader with dl_load_flags (this also helps
with the other XSLoader problem) and keep cf_linker_flags. It can simply
return an empty array on every platform but Windows.
+1
Glad to hear that moving to DynaLoader kills two birds with one stone!
I was initially concerned that we might end up creating fragile extensions on
Windows, but I'm reassured after snooping the code in
Clownfish::CFC::Perl::Build and reading this:
http://xenophilia.org/winvunix.html
In Windows, building A.dll will also build A.lib. You *do* pass A.lib to
the linker for B and C. A.lib does not contain code; it just contains
information which will be used at runtime to access A's code.
I assume that the extension does not need to be rebuilt if A.dll and A.lib are
updated, so long as they only change in ways that don't break A's ABI.
Yes, extensions don't have to be rebuilt. The .lib files are only needed
for linking with MSVC. GCC can link against DLLs directly. My latest
commits make compiled extensions work on Strawberry Perl (MinGW) and Cygwin.
Nick