CC: | perl5-porters [...] perl.org |
Subject: | Build fails (in blead, at least) with www.mingw.org's gcc-4.8.1 |
Trying to build bleadperl with www.mingw.org's gcc-4.8.1 (I just used the download/setup program from their website to get the latest version of everything) I first ran into a core problem with DllMain, which I have logged as rt.perl.org #121643, but will have fixed soon (DllMain's first parameter should be a HINSTANCE, not a HANDLE). Having got over that the build then continued as far as the cpan/Win32 extension, which failed with the output below, in which the main error is "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead" from c:\dev\software\mingw\4.8.1\include\ws2tcpip.h:38:2.
I will leave the rt.perl.org ticket open until this rt.cpan.org ticket is also fixed since blead won't build with www.mingw.org's gcc-4.8.1 until this is also fixed.
Note that the rt.perl.org ticket is marked as a blocker for the release of Perl 5.20, due in the next month or so, so a new Win32 CPAN release with this fixed would be greatly appreciated.
Simply inserting
#include <winsock2.h>
before #include <windows.h> in Win32.xs fixed the problem for me, but I have not considered whether that's an appropriate patch in all cases, especially for older perls.
Running Makefile.PL in cpan/Win32
C:\Dev\Git\perl\win32\..\miniperl.exe -I../../lib Makefile.PL INSTALLDIRS=perl I
NSTALLMAN1DIR=none INSTALLMAN3DIR=none PERL_CORE=1
Generating a dmake-style Makefile
Writing Makefile for Win32
Making all in cpan/Win32
dmake -S all PERL_CORE=1
cp Win32.pm ..\..\lib\Win32.pm
Running Mkbootstrap for Win32 ()
C:\Dev\Git\perl\miniperl.exe "-I..\..\lib" "-I..\..\lib" -MExtUtils::Command -e
chmod -- 644 Win32.bs
..\..\miniperl.exe "-I..\..\lib" "-I..\..\lib" ..\..\lib\ExtUtils\xsubpp -typem
ap ..\..\lib\ExtUtils\typemap Win32.xs > Win32.xsc && C:\Dev\Git\perl\miniperl.
exe "-I..\..\lib" "-I..\..\lib" -MExtUtils::Command -e mv -- Win32.xsc Win32.c
gcc -c -s -O2 -DWIN32 -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -
DPERL_IMPLICIT_SYS -DUSE_PERLIO -fno-strict-aliasing -mms-bitfields -s -O2
-DVERSION=\"0.48\" -DXS_VERSION=\"0.48\" "-I..\..\lib\CORE" Win32.c
In file included from ..\..\lib\CORE/sys/socket.h:30:0,
from ..\..\lib\CORE/win32.h:395,
from ..\..\lib\CORE/win32thread.h:4,
from ..\..\lib\CORE/perl.h:2657,
from Win32.xs:7:
c:\dev\software\mingw\4.8.1\include\ws2tcpip.h:38:2: error: #error "ws2tcpip.h i
s not compatible with winsock.h. Include winsock2.h instead."
#error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead
."
^
In file included from ..\..\lib\CORE/sys/socket.h:30:0,
from ..\..\lib\CORE/win32.h:395,
from ..\..\lib\CORE/win32thread.h:4,
from ..\..\lib\CORE/perl.h:2657,
from Win32.xs:7:
c:\dev\software\mingw\4.8.1\include\ws2tcpip.h:147:8: error: redefinition of 'st
ruct ip_mreq'
struct ip_mreq {
^
In file included from c:\dev\software\mingw\4.8.1\include\windows.h:93:0,
from Win32.xs:2:
c:\dev\software\mingw\4.8.1\include\winsock.h:315:8: note: originally defined he
re
struct ip_mreq {
^
In file included from Win32.xs:8:0:
..\..\lib\CORE/XSUB.h:546:0: warning: "fstat" redefined [enabled by default]
# define fstat PerlLIO_fstat
^
In file included from ..\..\lib\CORE/perl.h:1021:0,
from Win32.xs:7:
c:\dev\software\mingw\4.8.1\include\sys\stat.h:301:0: note: this is the location
of the previous definition
#define fstat _fstat
^
In file included from Win32.xs:8:0:
..\..\lib\CORE/XSUB.h:557:0: warning: "stat" redefined [enabled by default]
# define stat(buf,sb) PerlLIO_stat(buf,sb)
^
In file included from ..\..\lib\CORE/perl.h:1021:0,
from Win32.xs:7:
c:\dev\software\mingw\4.8.1\include\sys\stat.h:300:0: note: this is the location
of the previous definition
#define stat _stat
^
dmake: Error code 129, while making 'Win32.o'
Unsuccessful make(cpan/Win32): code=65280 at ..\make_ext.pl line 561.
dmake: Error code 130, while making 'Extensions'