Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: stahta01 on November 13, 2013, 04:07:03 pm

Title: Patches for Compiling Code::Blocks against wxWidgets 3.0 using MinGW GCC 4.8.1
Post by: stahta01 on November 13, 2013, 04:07:03 pm
Moved my patches to here to compile Code::Blocks using wxWidgets 3.0 and TDM MinGW GCC 4.8.1

The reason for this group of patches  is because TDM's MinGW GCC version 4.8.1 crashes if PCH of sdk.h is used during building of Code::Blocks.
If the including of wxprec.h is stopped the crashing does NOT happen.
Crash message below.
Code
cc1plus.exe has stopped working.
More info on crash in wxForum thread http://forums.wxwidgets.org/viewtopic.php?f=19&t=38116 (http://forums.wxwidgets.org/viewtopic.php?f=19&t=38116)



Edit:Removed two old patches.

Tim S.



Title: Re: Patches for Compiling Code::Blocks against wxWidgets 3.0 using MinGW GCC 4.8.1
Post by: oBFusCATed on November 13, 2013, 04:20:29 pm
stahta01:
I'm totally lost in your patches and your topics (you have several of both).

Can I ask you to post an exact description what and why do you want to improve for every patch?
Also making a git branch based on mine or biplap's repo with all your commits in a proper order with proper
commit messages would be quite helpful and would increase the chance for your changes to get in SVN.
Title: Re: Patches for Compiling Code::Blocks against wxWidgets 3.0 using MinGW GCC 4.8.1
Post by: stahta01 on November 13, 2013, 04:25:14 pm
stahta01:
I'm totally lost in your patches and your topics (you have several of both).

Can I ask you to post an exact description what and why do you want to improve for every patch?
Also making a git branch based on mine or biplap's repo with all your commits in a proper order with proper
commit messages would be quite helpful and would increase the chance for your changes to get in SVN.


I just added some descriptions; do you need longer ones?
Or are they not clear enough?
Or need more reasons?

Do you think the wx/gauge.h should be included in sdk_common.h?
I am of two minds on what is best to do on that.

Tim S.
 
Title: Re: Patches for Compiling Code::Blocks against wxWidgets 3.0 using MinGW GCC 4.8.1
Post by: killerbot on November 13, 2013, 09:34:12 pm
suggestion : let us just stop using PCH's.

Compiling CB goes rather quickly (even without using pch's) and when one can use multi cores it goes amazingly fast.

Time after time, this is biting us. Let's try without and see where we end up ?
Title: Re: Patches for Compiling Code::Blocks against wxWidgets 3.0 using MinGW GCC 4.8.1
Post by: oBFusCATed on November 13, 2013, 10:08:07 pm
Do you think the wx/gauge.h should be included in sdk_common.h?
I don't know, what difference does it make?
Title: Re: Patches for Compiling Code::Blocks against wxWidgets 3.0 using MinGW GCC 4.8.1
Post by: stahta01 on November 14, 2013, 12:58:29 am
Do you think the wx/gauge.h should be included in sdk_common.h?
I don't know, what difference does it make?

If you use PCH correctly you need to fix the code so it compiles.
My patches work; if you wish to speed up compiling including a header only used once in the PCH wastes time and memory.
But, right now we are including all the headers inside wx/prec.h inside the SDK.h PCH.

Tim S.
Title: Re: Patches for Compiling Code::Blocks against wxWidgets 3.0 using MinGW GCC 4.8.1
Post by: stahta01 on November 14, 2013, 03:29:12 am
suggestion : let us just stop using PCH's.

Compiling CB goes rather quickly (even without using pch's) and when one can use multi cores it goes amazingly fast.

Time after time, this is biting us. Let's try without and see where we end up ?

I could try that route; I am nearly positive the 4.8.1 crash will go away.
Building of the Code::Blocks core project will likely be slower.
But, since the contrib projects already do NOT use the PCH version of sdk.h they should be no slower.
And, removing the flags doing precomp should speed up the building of the Contrib projects.

Will see if this solution works for 4.8.1 and see if it speeds up building CB Core project after I turn off the precomp flags.

Tim S.
Title: Re: Patches for Compiling Code::Blocks against wxWidgets 3.0 using MinGW GCC 4.8.1
Post by: ollydbg on December 30, 2013, 02:42:15 am
FYI:

Hi, Tim and other guys, I just update a GCC bug:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56926

I can reproduce the bug with a very simple test code (only MinGW compiler suite and boost header files are needed), so it looks like GCC can not read/handle big PCH files. See this Comment 6 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56926#c6) with steps.
Title: Re: Patches for Compiling Code::Blocks against wxWidgets 3.0 using MinGW GCC 4.8.1
Post by: ollydbg on May 31, 2015, 10:27:08 am
Nowadays, I'm trying to find the reason why the big pch will cause gcc crash. Now, I see that I may find the reason, the hard limited pch file size is around 128M, see my post in mingw-w64 forum for the information. [Mingw-w64-public] Set a larger pch file size limit? was : can anyone supply a debug version of cc1plus.exe? (https://sourceforge.net/p/mingw-w64/mailman/message/34159267/)

Any one can build a new gcc tool chain which has larger hard coded value?
Title: Re: Patches for Compiling Code::Blocks against wxWidgets 3.0 using MinGW GCC 4.8.1
Post by: stahta01 on May 31, 2015, 10:41:38 pm
Nowadays, I'm trying to find the reason why the big pch will cause gcc crash. Now, I see that I may find the reason, the hard limited pch file size is around 128M, see my post in mingw-w64 forum for the information. [Mingw-w64-public] Set a larger pch file size limit? was : can anyone supply a debug version of cc1plus.exe? (https://sourceforge.net/p/mingw-w64/mailman/message/34159267/)

Any one can build a new gcc tool chain which has larger hard coded value?

I have given up on finding the PCH build size issue cause.

But, I am now trying to cross build Code::Blocks under Debian Jessie using MinGW64 gcc for 32 bit build.
If I can duplicate the error under Debian Jessie, would that help you find the PCH bug?

Tim S.
Title: Re: Patches for Compiling Code::Blocks against wxWidgets 3.0 using MinGW GCC 4.8.1
Post by: ollydbg on June 01, 2015, 02:36:15 am
Hi, Tim, I think the linux hosted gcc can handle big pch files quite well, so this can't help to solve the window hosted gcc issue. Thanks.
Title: Re: Patches for Compiling Code::Blocks against wxWidgets 3.0 using MinGW GCC 4.8.1
Post by: ollydbg on June 02, 2015, 07:32:37 am
Good news, good news, the crash issue can be solved. See solutions in my Comment 17 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56926#c17) in gcc bugzilla. Though I don't have the ability to build a gcc toolchain under windows, I can use the binary(hex) editor to modify the cc1plus.exe, and the result gcc don't crash when a 200M pch file is used.  :)
Title: Re: Patches for Compiling Code::Blocks against wxWidgets 3.0 using MinGW GCC 4.8.1
Post by: oBFusCATed on June 02, 2015, 08:27:12 am
Probably you should talk to TDragon about this? :)
Title: Re: Patches for Compiling Code::Blocks against wxWidgets 3.0 using MinGW GCC 4.8.1
Post by: ollydbg on June 02, 2015, 08:52:10 am
Probably you should talk to TDragon about this? :)
I have posted those messages in mingw-w64 maillist, so I think John can see this, hope he can make new releases with those patch applied. :)
Title: Re: Patches for Compiling Code::Blocks against wxWidgets 3.0 using MinGW GCC 4.8.1
Post by: ollydbg on September 22, 2015, 11:52:35 pm
Some good news: I recently see one gcc toolchain released which can handle big pch file without crash is mingw-build(from mingw-w64 site)
MinGW-w64 - for 32 and 64 bit Windows - Browse /Toolchains targetting Win32/Personal Builds/mingw-builds/5.2.0 at SourceForge.net (https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/5.2.0/)

It include a patch 410-fix-using-large-pch.patch (https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-gcc/410-fix-using-large-pch.patch) (Or the same one in mingw-build repo gcc-5.2-fix-mingw-pch.patch (https://github.com/niXman/mingw-builds/blob/develop/patches/gcc/gcc-5.2-fix-mingw-pch.patch))

So, I can turn on the pch feature when building c::b against wx3.x, anyone knows a simple patch to enable pch on the windows C::B wx30 cbp file? Thanks.
Title: Re: Patches for Compiling Code::Blocks against wxWidgets 3.0 using MinGW GCC 4.8.1
Post by: ollydbg on September 22, 2015, 11:54:33 pm
Search the forum, I see that we have a discussion here: patch to build C::B against wx 3.0 with PCH enabled (http://forums.codeblocks.org/index.php/topic,18821.msg128936.html#msg128936), its two years ago, not sure the patch is still valid.  ;)
Title: Re: Patches for Compiling Code::Blocks against wxWidgets 3.0 using MinGW GCC 4.8.1
Post by: oBFusCATed on September 23, 2015, 07:27:50 pm
Do you want to build 64 bit version of C::B, because the 32bit one builds just fine using the latest TDM build?
Title: Re: Patches for Compiling Code::Blocks against wxWidgets 3.0 using MinGW GCC 4.8.1
Post by: ollydbg on September 24, 2015, 02:28:42 am
Do you want to build 64 bit version of C::B,
NO. I'm on WinXP 32bit system.

Quote
because the 32bit one builds just fine using the latest TDM build?
Yes, it is "fine", but it is now with PCH disabled when build C::B against wx3.x library, because when enabling pch, the big pch file will cause gcc crash. (the pch file when using wx2.8.12 is a bit small, thus it doesn't cause the gcc crash).
Title: Re: Patches for Compiling Code::Blocks against wxWidgets 3.0 using MinGW GCC 4.8.1
Post by: MortenMacFly on September 25, 2015, 11:44:22 am
So, I can turn on the pch feature when building c::b against wx3.x, anyone knows a simple patch to enable pch on the windows C::B wx30 cbp file?
Just compare the wx28 and wx30 CBP file:

Its basically:
1.) Enable the warning -Winvalid-pch
2.) remove the NOPCH #define
3.) Add the CB_PRECOMP and WX_PRECOMP #define.
4.) Enable compilation of include/sdk.h and include/sdk_precomp.h

...that should be pretty much it. unfortunately you have to do it for all WX30 files... but for the beginning, the SDK, Core and wxSmithXXX might be well enough to speed up compiling a lot.

don't forget to do a re-build.
Title: Re: Patches for Compiling Code::Blocks against wxWidgets 3.0 using MinGW GCC 4.8.1
Post by: ollydbg on September 27, 2015, 09:06:55 am
Hi, Morten, thanks, I can successfully build CodeBlocks_wx30.cbp with PCH enabled (under gcc 5.2).
I use my own patch here: patch to build C::B against wx 3.0 with PCH enabled (http://forums.codeblocks.org/index.php/topic,18821.msg128936.html#msg128936)

All the method I used will be posted in a single thread: Build C::B against wx3.02 with gcc 5.2 under Windows (http://forums.codeblocks.org/index.php/topic,20607.msg140163/topicseen.html#msg140163)