Skip Menu |

This queue is for tickets about the Alien-wxWidgets CPAN distribution.

Report information
The Basics
Id: 53584
Status: resolved
Priority: 0/
Queue: Alien-wxWidgets

People
Owner: Nobody in particular
Requestors: kmx [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Another 64-bit troubles with mingw-w64 compiler
Hi, I have done another testing with mingw-w64 bit compiler. After fixing #53471 and #53293 Alien::wxWidgets works nice with 32-bit compiler from mingw-w64 projects. However there are still some issue concerning 64-bit compiler by mingw-w64 (yes they do not deliver only 64-bit compiler). Here are 2 of them (both tested on Alien::wxWidgets 0.50 + wxWidgets-2.8.10): 1) filefn.h issue I have experienced this error during compilation: g++ -c -o gcc_mswudll\basedll_appbase.o -O2 -mthreads -DHAVE_W32API_H -D__WXMSW__ -D_UNICODE -I..\..\lib\gcc_dll\mswu -I..\..\include -Wall -I..\..\src\tiff -I..\..\src\jpeg -I..\..\src\png -I..\..\src\zlib -I..\..\src\regex -I..\..\src\expat\lib -DwxUSE_GUI=0 DWXMAKINGDLL_BASE -DwxUSE_BASE=1 -Wno-ctor-dtor -privacy -MTgcc_mswudll\basedll_appbase.o -MFgcc_mswudll\basedll_appbase.o.d -MD -MP ../../src/common/appbase.cpp In file included from ..\..\include/wx/utils.h:21, from ../../src/common/appbase.cpp:35: ..\..\include/wx/filefn.h:286: error: 'stati64' in namespace '::' does not name a type make: *** [gcc_mswudll\basedll_appbase.o] Error 1 The problem is in this section of filefn.h: #if defined(__BORLANDC__) || defined(__DMC__) || defined(__WATCOMC__) || defined(__MINGW64__) #define wxPOSIX_IDENT(func) ::func #else // by default assume MSVC-compatible names #define wxPOSIX_IDENT(func) _ ## func #define wxHAS_UNDERSCORES_IN_POSIX_IDENTS #endif I do not know why there is defined(__MINGW64__) because AFAIK mingw-w64 compiler fits into #else branche (uses underscore). Fix is to remove defined(__MINGW64__) from #if condition Note: __MINGW64__ is defined by 64-bit compiler from mingw-w64 project __MINGW32__ is defined by both 32/64-bit compilers from mingw-w64 project 2) Problem with src/msw/thread.cpp g++ -c -o gcc_mswudll\basedll_thread.o -O2 -mthreads -DHAVE_W32API_H -D__WXMSW__ -D_UNICODE -I..\..\lib\gcc_dll\mswu -I..\..\include -Wall -I..\..\src\tiff -I..\..\src\jpeg -I..\..\src\png -I..\..\src\zlib -I..\..\src\regex -I..\..\src\expat\lib -DwxUSE_GUI=0 -DWXMAKINGDLL_BASE -DwxUSE_BASE=1 -Wno-ctor-dtor-privacy -MTgcc_mswudll\basedll_thread.o -MFgcc_mswudll\basedll_thread.o.d -MD -MP ../../src/msw/thread.cpp ../../src/msw/thread.cpp: In static member function 'static THREAD_RETVAL wxThreadInternal::DoThreadStart(wxThread*)': ../../src/msw/thread.cpp:525: error: cast from 'void*' to 'THREAD_RETVAL' losesprecision ../../src/msw/thread.cpp: In member function 'wxThreadError wxThreadInternal::WaitForTerminate(wxCriticalSection&, void**, wxThread*)': ../../src/msw/thread.cpp:845: error: cast from 'void*' to 'DWORD' loses precision ../../src/msw/thread.cpp: In member function 'void wxThread::Exit(void*)': ../../src/msw/thread.cpp:1165: error: cast from 'void*' to 'unsigned int' loses precision gmake: *** [gcc_mswudll\basedll_thread.o] Error 1 The problem is IMHO in this section of // define wxUSE_BEGIN_THREAD if the compiler has _beginthreadex() function // which should be used instead of Win32 ::CreateThread() if possible #if defined(__VISUALC__) || \ (defined(__BORLANDC__) && (__BORLANDC__ >= 0x500)) || \ (defined(__GNUG__) && defined(__MSVCRT__)) || \ defined(__WATCOMC__) || defined(__MWERKS__) as it should contain also defined(__MINGW64__) or perhaps also defined(__MINGW32__) - in case of incompatibility with mingw.org headers we can use defined(__MINGW64_VERSION_MAJOR). Unfortunately I am short of time to test it further now, I just want to keep a record of my up-to-now findings. If anybody wants to analyse issues on MS Windows 64-bit platform here you can download my strawberry-like manual build of 64-bit perl: http://svn.ali.as/cpan/users/kmx/strawberry_64bit-pre/ -- kmx
Hi,

I am back with a patch for enabling Alien::wxWidgets to build via 64bit mingw-w64 compiler.

1/ it turns out that it is nearly impossible to make wxwidgets 2.8.10 to build via 64bit gcc from mingw-w64.sf.net

2/ so I have focused just on 2.9.0 and I was successfull


Please find eclosed files:

a/ Alien-wxWidgets-0.50_01-win64.patch  - changes Build.PL + patches\data-2.9.0

b/ patches/wxMSW-2.9.0-makefiles.patch - updated file

c/ patches/wxMSW-2.9.0-w64-filefn.patch - new file

I have successfully tested patched Alien::wxWidgets on the following MS Win compilers
- 32bit/gcc3 (currently used in strawberry perl 5.8/5.10)
- 32bit/gcc4 (expected to be used in upcomming strawberry perl 5.11/5.12)
- 64bit/gcc4 (expected to be used in upcomming strawberry perl 5.11/5.12)

--
kmx
files
Subject: Alien-wxWidgets-0.50_01-win64.patch
diff -ru Alien-wxWidgets-0.50_01.orig\Build.PL Alien-wxWidgets-0.50_01.64b\Build.PL --- Alien-wxWidgets-0.50_01.orig\Build.PL Fri Feb 26 17:10:01 2010 +++ Alien-wxWidgets-0.50_01.64b\Build.PL Thu Mar 11 11:39:34 2010 @@ -5,6 +5,7 @@ use strict; use lib "lib", "inc"; use My::Build; +use Config; our( $TYPE, $URL ); @@ -22,6 +23,17 @@ ========================================================== EOT exit 1; +} + +if( ($^O eq 'MSWin32') && ($Config{cc} =~ /gcc/) && ($Config{archname} eq 'MSWin32-x64-multi-thread') ) { + print <<EOT; +========================================================== +You are running 64bit perl on MS Windows (gcc compiler). +On this platform it is supported to build just wxwidgets +version 2.9.0 (or higher). +========================================================== +EOT + $DEFAULT_VERSION = '2.9.0'; } # new_from_context is broken: it does not restore diff -ru Alien-wxWidgets-0.50_01.orig\patches\data-2.9.0 Alien-wxWidgets-0.50_01.64b\patches\data-2.9.0 --- Alien-wxWidgets-0.50_01.orig\patches\data-2.9.0 Fri Feb 26 17:10:01 2010 +++ Alien-wxWidgets-0.50_01.64b\patches\data-2.9.0 Wed Mar 10 23:37:35 2010 @@ -12,6 +12,7 @@ wxMSW-2.9.0-makefiles.patch wxMSW-2.9.0-version.patch wxMSW-2.8.10-mingw64.patch +wxMSW-2.9.0-w64-filefn.patch ), @common ], }, mac => { unicode => [ qw(wxMac-2.9.0-textctrl.patch
Subject: wxMSW-2.9.0-w64-filefn.patch
--- include\wx\filefn.h Fri Sep 04 06:51:54 2009 +++ include\wx\filefn.h Wed Mar 10 21:41:47 2010 @@ -203,7 +203,7 @@ // to avoid using them as they're not present in earlier versions and // always using the native functions spelling is easier than testing for // the versions - #if defined(__BORLANDC__) || defined(__DMC__) || defined(__WATCOMC__) || defined(__MINGW64__) + #if defined(__BORLANDC__) || defined(__DMC__) || defined(__WATCOMC__) #define wxPOSIX_IDENT(func) ::func #else // by default assume MSVC-compatible names #define wxPOSIX_IDENT(func) _ ## func
Subject: wxMSW-2.9.0-makefiles.patch

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #53584] Another 64-bit troubles with mingw-w64 compiler
Date: Thu, 11 Mar 2010 22:02:00 +0100
To: bug-Alien-wxWidgets [...] rt.cpan.org
From: Mattia Barbon <mattia.barbon [...] libero.it>
kmx via RT wrote: Hi, Show quoted text
> I am back with a patch for enabling Alien::wxWidgets to build via 64bit > mingw-w64 compiler. > > 1/ it turns out that it is nearly impossible to make wxwidgets 2.8.10 to build > via 64bit gcc from mingw-w64.sf.net > > 2/ so I have focused just on 2.9.0 and I was successfull > > > Please find eclosed files: > > a/ Alien-wxWidgets-0.50_01-win64.patch - changes Build.PL + patches\data-2.9.0
I will not apply the patch to automatically switch to wxWidgets 2.9.0, for the same reasons A::wx does not build 2.9.x on 64 bit OS X: if somebody _wants_ to try 2.9.x he can, but users installing it as a dependency of (say) Padre should not get a wx development version as default. Show quoted text
> b/ patches/wxMSW-2.9.0-makefiles.patch - updated file
The only change is a s/-lwsock32/-lws2_32/, right? Show quoted text
> c/ patches/wxMSW-2.9.0-w64-filefn.patch - new file
Will apply. Thanks! Mattia
Subject: Re: [rt.cpan.org #53584] Another 64-bit troubles with mingw-w64 compiler
Date: Fri, 12 Mar 2010 09:37:51 +0100
To: bug-Alien-wxWidgets [...] rt.cpan.org
From: kmx <kmx [...] volny.cz>
Show quoted text
>> a/ Alien-wxWidgets-0.50_01-win64.patch - changes Build.PL + patches\data-2.9.0 >>
> I will not apply the patch to automatically switch to wxWidgets > 2.9.0, for the same reasons A::wx does not build 2.9.x on 64 bit OS X: > if somebody _wants_ to try 2.9.x he can, but users installing it as a > dependency of (say) Padre should not get a wx development version as > default. >
OK, but maybe it is worth at least to show users the warning about expected troubles (note that I have changed the default just for MS Windows 64bit + gcc). As wx-2.8.10 simply cannot be build on 64bit MS Windows via gcc, Padre users on 64bit MS Windows installing A:wx as a dependecy with current defaults will end up with build failure. On the other hand I have to admit that there are some strange 64bit troubles with Wx module so it wont be easy to install Padre on 64bit MS Windows anyway. Show quoted text
>> b/ patches/wxMSW-2.9.0-makefiles.patch - updated file >>
> The only change is a s/-lwsock32/-lws2_32/, right? >
Exactly, as there is no wsock32 on 64bit MS Windows, on the other hand ws2_32works with both (32/64bit) Thanks for prompt response. -- kmx
Il Ven 12 Mar 2010 03:39:07, kmx@volny.cz ha scritto: Show quoted text
>
> >> a/ Alien-wxWidgets-0.50_01-win64.patch - changes Build.PL +
> patches\data-2.9.0
> >>
> > I will not apply the patch to automatically switch to wxWidgets > > 2.9.0, for the same reasons A::wx does not build 2.9.x on 64 bit OS
> X:
> > if somebody _wants_ to try 2.9.x he can, but users installing it as
> a
> > dependency of (say) Padre should not get a wx development version as > > default. > >
> OK, but maybe it is worth at least to show users the warning about > expected troubles (note that I have changed the default just for MS > Windows 64bit + gcc).
I looked at the failures in the 2.8 branch (2.8.11-to-be) and they seem fixable with some selective backport. I will try to fix them in the weekend. Show quoted text
> As wx-2.8.10 simply cannot be build on 64bit MS Windows via gcc, Padre > users on 64bit MS Windows installing A:wx as a dependecy with current > defaults will end up with build failure.
If I can't fix 2.8 to compile, I will add an error message (like it's done for OS X). Show quoted text
> On the other hand I have to admit that there are some strange 64bit > troubles with Wx module so it wont be easy to install Padre on 64bit > MS > Windows anyway.
I don't know if you also tested with a 32 bit 2.9.0. Maybe they're just 2.9.0 problems and not related to 64 bit? Regards, Mattia
Subject: Re: [rt.cpan.org #53584] Another 64-bit troubles with mingw-w64 compiler
Date: Fri, 12 Mar 2010 14:06:14 +0100
To: bug-Alien-wxWidgets [...] rt.cpan.org
From: kmx <kmx [...] volny.cz>
Show quoted text
>> On the other hand I have to admit that there are some strange 64bit >> troubles with Wx module so it wont be easy to install Padre on 64bit >> MS Windows anyway. >>
> I don't know if you also tested with a 32 bit 2.9.0. Maybe they're > just 2.9.0 problems and not related to 64 bit? >
You are right, I have not checked if the same troubles occurs also on 32bit + 2.9.0 (checked only 32bit + 2.8.10). -- kmx
[sorry if you get this twice] Il Ven 12 Mar 2010 04:28:34, MBARBON ha scritto: Show quoted text
> Il Ven 12 Mar 2010 03:39:07, kmx@volny.cz ha scritto:
> > OK, but maybe it is worth at least to show users the warning about > > expected troubles (note that I have changed the default just for MS > > Windows 64bit + gcc).
> > I looked at the failures in the 2.8 branch (2.8.11-to-be) and they > seem fixable with some selective backport. I will try to fix them in > the weekend.
I added a patch set to A::wx and committed a one-line patch to wxPerl and it seems to work (a quick tour of the Demo shows no obvious errors). YMMV. Regards, Mattia
Show quoted text
> I added a patch set to A::wx and committed a one-line patch to
> wxPerl and it seems to work (a quick tour of the Demo shows no obvious
> errors). YMMV.

I can confirm, that on 64bit Strawberry Perl 5.12.0-RC0 Alien-wxWidgets-0.50_02 (wx2.8.10) builds OK.

I only needed to fix separately reported issue:
http://rt.cpan.org/Ticket/Display.html?id=56057

--
kmx