Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: eXpl0it3r on August 09, 2013, 11:53:03 am

Title: Changing MinGW compiler, which ships with C::B
Post by: eXpl0it3r on August 09, 2013, 11:53:03 am
Are there any plans to changing the default compiler, that ships with Code::Blocks?

The reason why I ask this, is that the TDM builds are not very good to work with. If you go out there and look at oh so many different gcc-like systems, you'll find that they all use -static -static-libstdc++ -static-libgcc and only the TDM builds are so awkward in ignoring or even crashing those flags. Instead TDM links the runtime libraries always static and if you want it to be dynamically linked, you'll have to go and define -shared -shared-libstdc++ -shared-libgcc. In a sense this setup is breaking about any building script out there.
I'm creating Unofficial Nightly Builds (http://sfml.my-gate.net/nightly/) for SFML (http://www.sfml-dev.org/) and Thor (http://www.bromeon.ch/libraries/thor/) and always have to customize the building script, to correctly build those libraries with the MinGW TDM versions.

I understood the change back when the official MinGW branch was a bit outdated, but now that they are even a minor version further than the TDM builds (GCC 4.7.2), I'd really like to see Code::Blocks switching back to the official releases. Of course one could also discuss about using the MinGW-builds (http://sourceforge.net/projects/mingwbuilds/).

So what is your main decision for keeping TDM and how do you guys feel about switching to a more "standard" compiler?

As an active member of the SFML forum, I'd be very happy to see the change, because currently we've builds for the official MinGW and the TDM builds and not many user understand the difference and you can be sure many will pick the wrong version...
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: oBFusCATed on August 09, 2013, 12:43:24 pm
Are there any plans to changing the default compiler, that ships with Code::Blocks?
I don't think so, all windows c::b developers like the TDM releases. The MinGW are pain to install at least from what I remember.
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: eXpl0it3r on August 09, 2013, 01:37:06 pm
I don't think so, all windows c::b developers like the TDM releases.
Hrmpf, I guess they only use it for developing Code::Blocks then... :-\

The MinGW are pain to install at least from what I remember.
Not sure from when you remember that, but it's really not (download setup, check only MinGW, install) and since they'd distribute with their package, it's really as simple as installing it once, copying the files and ship the other MinGW version.
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: oBFusCATed on August 09, 2013, 01:45:41 pm
Not sure from when you remember that, but it's really not (download setup, check only MinGW, install) and since they'd distribute with their package, it's really as simple as installing it once, copying the files and ship the other MinGW version.
Looking at their download page it is still the same and rather complicated.
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: stahta01 on August 09, 2013, 02:25:43 pm
If there is real bugs, I suggest reporting them to the TDM site.

I suggest reporting them as it would be nice if it worked more like the standard MinGW compiler.
And, have real test cases for showing the problem.

Tim S.
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: eXpl0it3r on August 09, 2013, 02:47:26 pm
Looking at their download page it is still the same and rather complicated.
Sorry, but can you please take things a bit more serious.
I agree their site isn't very nicely done and the direct link to Sourceforge for download might seem a bit cumbersome, but all of that doesn't even matter in the slightest for the request I'm making. If the official MinGW version gets included in the Code::Blocks distribution, instead of the TDM version, then the user will NEVER have to go to the MinGW website, since it's already included. The only time the site needs to be visited is, the first time MinGW gets packaged for the Code::Blocks bundle.
I have enough confidence in the developers of Code::Blocks, so I think they'll manage to get to the MinGW installer (http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/mingw-get-inst-20120426/mingw-get-inst-20120426.exe/download) and install MinGW like any other software.

If there is real bugs, I suggest reporting them to the TDM site.
It's not a bug, it's intentionally compiled like that and I guess the guy behind TDM thought it would be a nice feature, but it essentially just makes the MinGW TDM rather useless.
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: oBFusCATed on August 09, 2013, 03:08:45 pm
Sorry, but can you please take things a bit more serious.
I'm totally serious here. I do windows development like all other people do linux dev - trying to follow the least resistance.
And mingw has pretty high resistance to me. :)
I've never installed the integrated package, so I might not count anyway. :)

It's not a bug, it's intentionally compiled like that and I guess the guy behind TDM thought it would be a nice feature, but it essentially just makes the MinGW TDM rather useless.
Then why don't you try to convince TDragon (http://forums.codeblocks.org/index.php?action=profile;u=660) to change his build?
It won't hurt if you try it. I hope you don't want us to change the installers for 12.11, do you?

Title: Re: Changing MinGW compiler, which ships with C::B
Post by: eXpl0it3r on August 09, 2013, 03:38:33 pm
trying to follow the least resistance.
And mingw has pretty high resistance to me. :)
This just sounds like you're too lazy to actually look into it. :-\
It's "okay" to be lazy if you don't do anything essential, but if you're developing on a bigger project, e.g. like Code::Blocks for Windows, it's just naive not to look at the possibilities at hand just because one has to click, read and think a bit more.
And if you only follow the least resistance, then you'd long be using the MinGW-builds, since they are just an archive with up-to-date compilers...

Then why don't you try to convince TDragon (http://forums.codeblocks.org/index.php?action=profile;u=660) to change his build?
It won't hurt if you try it.
Seeing that he's rather active on the forum here, I hope he'll read the thread and maybe give some insights on his decisions. If he doesn't respond any time soon, I'll pm him.

I hope you don't want us to change the installers for 12.11, do you?
Well if we have to wait another 2 years or so, for the next release of Code::Blocks, I'd suggest to change it.
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: stahta01 on August 09, 2013, 03:49:38 pm
Edit: Removed Quote to make thread easier to read.

@eXpl0it3r:

Its easy to use CB with a different MinGW Compiler; it just sounds like you are too lazy to support your users in doing that.

Tim S.
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: oBFusCATed on August 09, 2013, 03:51:32 pm
Well if we have to wait another 2 years or so, for the next release of Code::Blocks, I'd suggest to change it.
I suppose you know this won't happen, 100% guaranteed :)
And you wont have to wait for two years:)

BTW: C::B ships a compiler just for a convenience for the novice users. It is just that and there will be always people that would prefer one over the other version, or the third one.
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: eXpl0it3r on August 09, 2013, 03:59:40 pm
Its easy to use CB with a different MinGW Compiler; it just sounds like you are too lazy to support your users in doing that.
I know and I'm never using the TDM builds for my projects.
The problem is, even though there's a good tutorial that describes everything, people just don't read and don't bother with using something else, so they use the default one. This is always gonna happen, regardless of what anyone does, thus I'm trying to show why the current default compiler is flawed and should be replaced.

I've 6 different MinGW compilers installed and build my Nightly Builds for all of them (+ 4x Visual Studio), but the TDM builds are the only ones, where I've to run a special script to patch the source to make it work and since the biggest population is using the TDM compiler, I can't just drop it.

I suppose you know this won't happen, 100% guaranteed :)
And you wont have to wait for two years:)
Well just think about it for the next release then.

BTW: C::B ships a compiler just for a convenience for the novice users. It is just that and there will be always people that would prefer one over the other version, or the third one.
Yes of course, but it's not something to put a side that easily. Think about why Google pays Firefox a huge amount of money, so that they keep Google as default search engine and it works. As we've seen in the "discussion" above, people tend to go the way of least resistance and when you offer such a way, you'll also have to think about what you include and how it will affect the user base.
IMHO you can't just go and decline all the request with "You can also use other compilers.", when the default compiler Code::Blocks ships with is flawed.
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: huzhongshan on August 10, 2013, 12:54:38 am
I like TDM-gcc .
If you want to use another mingw , just delete directory Mingw and install Mingw(your version ) in that directory.
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: eXpl0it3r on August 10, 2013, 02:06:09 pm
I like TDM-gcc .
If you want to use another mingw , just delete directory Mingw and install Mingw(your version ) in that directory.
Please read the posts above why this should not be a viable option. ;)
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: TDragon on August 10, 2013, 07:47:49 pm
Hi eXpl0it3r,

I think the conflict lies in your expectation that TDM-GCC will conform to some standard form of behavior with respect to the command line. The way I see it, once I start patching GCC to behave differently, it becomes a different compiler and should be treated as such. You can't use the same command line flags to compile a program with MSVC that you use with GCC. If you have a program that compiles with GCC, and you want to port it to MSVC, you will have to make a careful examination of the differences between the two. The same goes for vanilla GCC and TDM-GCC. A user of vanilla GCC switching to TDM-GCC needs to be aware of the differences -- they are few, extremely important, and hopefully well-documented in the TDM-GCC README.

In the case of the static-by-default change, I carefully considered my options in the implementation and decided to have TDM-GCC reject -static-lib*** with an error precisely because this is safer than making it a no-op. Licensing concerns with the GPL (and associated exception clauses) make dynamic linking of libgcc and libstdc++ extremely dangerous to the casual user, so I want TDM-GCC to error out when the user assumes vanilla GCC behavior. This isn't an appropriate time or place for me to go into detail on the legal reasons behind this, so I hope you'll take my word for it as someone who has paid close attention to the discussions of this on the GCC and mingw-users mailing lists.

This is intended as a defense of my design choices with TDM-GCC, rather than of TDM-GCC's inclusion with Code::Blocks. I use Code::Blocks as my primary IDE in my software development work, and I'm very glad that TDM-GCC integrates so well with C::B. There are certainly valid reasons both in support of bundling it (such as Windows-friendliness) and against it (such as my struggle to build GCC 4.8 ), but as I'm not a C::B dev I'll simply leave it to those who are to make an informed decision about its suitability for inclusion as the default compiler.

In order to keep the conversation constructive and focused on Code::Blocks, this will be my only contribution to the thread.

Thanks,
John E. / TDM
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: eXpl0it3r on August 12, 2013, 05:07:01 pm
I think the conflict lies in your expectation that TDM-GCC will conform to some standard form of behavior with respect to the command line. The way I see it, once I start patching GCC to behave differently, it becomes a different compiler and should be treated as such. You can't use the same command line flags to compile a program with MSVC that you use with GCC. If you have a program that compiles with GCC, and you want to port it to MSVC, you will have to make a careful examination of the differences between the two. The same goes for vanilla GCC and TDM-GCC. A user of vanilla GCC switching to TDM-GCC needs to be aware of the differences -- they are few, extremely important, and hopefully well-documented in the TDM-GCC README.
While I somewhat agree, I still have to disagree. Although in theory you can look at TDM-GCC as it's "own" compiler, there's no way to actually test this. No third party application does have options to differentiate TDM from GCC, which is also where I have issues with SFML, because CMake doesn't know the difference between some custom GCC compiler and a normal behaving GCC compiler. While on the other hand, it supports all kind of different versions of MSVC and is able to create one NMake file, that will compile with all MSVC regardless of the version, as long as the environment variable are setup correctly.

So if we're not were to go and declare TDM-GCC it's own compiler version, it seems in my option that the website of TDM-GCC should make it clear on the front page, that the compiler should not be looked at as a normal GCC compiler. You maybe even want to drop the GCC, because GCC as describe by the official website:
Quote from: GCC GNU (http://gcc.gnu.org/)
The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, Ada, and Go, as well as libraries for these languages (libstdc++, libgcj,...). GCC was originally written as the compiler for the GNU operating system.
GCC represents front ends for C++, but by changing that front end to your own needs/ides, you're breaking what GCC stands for.

This also rolls over to Code::Blocks' default compiler and makes it clear, that if they go and ship a "GCC" compiler by default, it should also work like a GCC compiler.

In the case of the static-by-default change, I carefully considered my options in the implementation and decided to have TDM-GCC reject -static-lib*** with an error precisely because this is safer than making it a no-op. Licensing concerns with the GPL (and associated exception clauses) make dynamic linking of libgcc and libstdc++ extremely dangerous to the casual user, so I want TDM-GCC to error out when the user assumes vanilla GCC behavior. This isn't an appropriate time or place for me to go into detail on the legal reasons behind this, so I hope you'll take my word for it as someone who has paid close attention to the discussions of this on the GCC and mingw-users mailing lists.
Well as you might have thought, I have my doubts about this, since linking stuff dynamically has usually less legal issues, than linking something statically by default, e.g. GPL doesn't allow you to link commercial stuff statically. If you have any resources regarding this, I'd be very interested to read them (you can also PM me if you don't want to post here any further).

In order to keep the conversation constructive and focused on Code::Blocks, this will be my only contribution to the thread.
Thanks! Don't hesitate to post if you have further constructive comments though.
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: eXpl0it3r on October 13, 2014, 08:48:38 pm
Let's try this one more time, shall we? ;D

The TDM builds had its right place back when MinGW was still the main thing and not that many people were creating builds of the MinGW-w64 project. Nowadays however nearly everyone has dropped the original MinGW builds (no horrible install process anymore) and there are a number of different builds for the MinGW-w64 project. I solely mention this, because that seems to have been the main argument for choosing the TDM builds so far.
I know TDragon is part of this community and appreciate all his work, but for the sake of an objective discussion, could we please put personal matters aside and look at it technically?

So in case you didn't read the discussion above, here's again the problem space:

If you've never had an issue building something, then well you're lucky or haven't build (m)any libraries.
TDragon's argument about the licensing issue might be true (I'm not a lawyer so who knows), but just because of that breaking standard behavior is simply not something I can accept.
If you'd ask me, I'd suggest you should start using the MinGW Builds (http://mingw-w64.sourceforge.net/download.php#mingw-builds). They provide a clean installer (http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe/download) (similar to what TDragon has done), they provide all the setting choices you could want (Posix vs Win32, DW2 vs SJLJ vs SEH, x86 vs x64) are always uptodate with upstream (GCC 4.9.1r1 as of writing) and have worked with any build script I've thrown at it so far, thus standard GCC conforming.
Also if you want to see practical examples of TDM failing, just let me know - there are plenty.

It would be really nice, if we could get an objective discussion going in here. My last attempt only raise a few voices and non of the arguments provided hold any ground (anymore). :)
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: stahta01 on October 13, 2014, 09:01:48 pm
eXpl0it3r:

Do they (MinGW Builds) test building wxWidgets?

Because TDM does; and, I think this is likely a good requirement for the MinGW GCC toolchain bundled with Code::Blocks.

Edit: I think your suggestion is no good because you do NOT know what you suggested. You posted links to two different places!!

Tim S.
 
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: eXpl0it3r on October 13, 2014, 10:11:28 pm
Edit: I think your suggestion is no good because you do NOT know what you suggested. You posted links to two different places!!
Please tell me you're joking, please, please... :-\
I do know exactly, what I'm talking about. The first link points to the download page of the MinGW-w64 project, which features next to other builds the "MinGW Builds". The second link points directly to the installer of the "MinGW Builds" which is located in the MinGW-w64 SourceForge project. IF you're talking about the fact that there's a dedicated "MinGW Builds (http://sourceforge.net/projects/mingwbuilds/)" project on SourceForge, guess what they've moved to the MinGW-w64 project and the builds on the MinGW Builds project are outdated. I really, really hope this was some sort of a joke...

Do they (MinGW Builds) test building wxWidgets?

Because TDM does; and, I think this is likely a good requirement for the MinGW GCC toolchain bundled with Code::Blocks.
So you're suggesting that the TDM builds should be prefered because they check if a third-party library gets tested by the compiler builder? I'm aware that Code::Blocks is heavily depending on wxWidgets, but having the "requirement" that the compiler builder has to test a third-party library, is just seriously ridiculous. If wxWidgets can't be built with a standard conforming compiler, such as one from the MinGW Builds, then they might want to fix their code base.
If I were to only choose compiler builds for which the author did test all the libraries I imagine to use, then I'd never find a compiler...

Of course if all it takes is testing whether wxWidgets builds with a different compiler than TDM, by all means let me test it. wxWidgest is currently build with the MinGW Builds Posix Dwarf2 4.9.1r1 x86. However if you've ever built wxWidgets, you know it will take a while till it's finished, but rest assure, I'll post the binaries as soon as they been built - it's really not that hard. ;)

Edit: Well there are tons and tons of options, but with the "default" --enable-monolithic --enable-unicode it built just fine: wxWidgets2 (http://my-gate.net/pub/wxWidgets2-monolithic.7z) [7.85 MiB]
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: oBFusCATed on October 13, 2014, 11:37:29 pm
If wxWidget can't be built with a standard conforming compiler, such as one from the MinGW Builds, then they might want to fix their code base.

I hope you know that the C++ standard doesn't mention libraries nor command line flags and leaves them to the implementation!

Also I don't know why is this aggressive behaviour, why don't you just mention on your site that you don't support TDM and be done with it?

p.s. I don't really care what we ship as default compiler on windows as I don't use it  :P
p.p.s. I hope I won't see you in a 2-3-4 years starting a topic how we should drop TDM/MinGW in favour of clang!  :-* ;D
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: edison on October 14, 2014, 04:50:08 am
If my memory is correctly, the dw2 posix version TDM-GCC will use dyna link as default.
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: eXpl0it3r on October 14, 2014, 08:16:20 am
I hope you know that the C++ standard doesn't mention libraries nor command line flags and leaves them to the implementation!
I obviously wasn't talking about the C++ standard, but rather standard behavior for GCC compilers.

Also I don't know why is this aggressive behaviour, why don't you just mention on your site that you don't support TDM and be done with it?
See my point above about "setting defaults".

p.p.s. I hope I won't see you in a 2-3-4 years starting a topic how we should drop TDM/MinGW in favour of clang!  :-* ;D
I don't see why I shouldn't.

If my memory is correctly, the dw2 posix version TDM-GCC will use dyna link as default.
Even if it does, Code::Blocks doesn't ship DW2 POSIX version, thus it doesn't matter. Again the point is, Code::Blocks is setting a "default" compiler by shipping the TDM builds and that "default" compiler is broken. Anyone should be able to use TDM if they really want, I just talk about changing the compiler that gets shipped with Code::Blocks.
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: oBFusCATed on October 14, 2014, 09:41:30 am
I obviously wasn't talking about the C++ standard, but rather standard behavior for GCC compilers.
I really doubt there is such thing as standard, also as far as I know these options you're talking about are relatively new additions to GCC.

p.p.s. I hope I won't see you in a 2-3-4 years starting a topic how we should drop TDM/MinGW in favour of clang!  :-* ;D
I don't see why I shouldn't.
Because this won't help C::B to become better.

As I've said why don't you just state that you don't support TDM and be done with it?
Close any ticket related to it with invalid and go on.
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: eXpl0it3r on October 14, 2014, 10:20:43 am
I really doubt there is such thing as standard, also as far as I know these options you're talking about are relatively new additions to GCC.
If you're caught up too much with the word "standard", then I might have to defuse it to "default behavior" or "how ever other GCC version in existence works".
Whether they are new or old doesn't matter.

As I've said why don't you just state that you don't support TDM and be done with it?
Close any ticket related to it with invalid and go on.
Because I want to solve the issue at its root rather than just switching to "ignore mode". Again read the bit about setting a default compiler from above. This issue doesn't just touch my projects, it affects every project out there.

If you don't care what compiler gets shipped, why don't you even want to think about a change?

Again all the arguments about "use something else" or "ignore it" etc. are not actual solutions to the problem I'm presenting here. It's not just about my personal projects and the ones I'm involved with, but it's about Code::Blocks setting a default compiler for a lot of users without realizing and without admitting that their shipped compiler has major flaws.
Title: Re: Changing MinGW compiler, which ships with C::B
Post by: TDragon on October 15, 2014, 05:14:02 am
The compiler will generate an error when using the common -static linker flag.

Could you provide some more information about this specific problem by any chance? It's not something I've ever been made aware of, and I'd like to see if it's something I could fix. I'd be very grateful for a bug report at the TDM-GCC tracker (https://sourceforge.net/p/tdm-gcc/bugs/) (preventing off-topic discussion here).

Also, in the intervening time since we last conversed, TDM-GCC has changed to allow the "-static-libgcc" and "-static-libstdc++" flags as no-ops. I'm not sure if this answers your objection to the default static linkage or not, but I figured it was worth a mention. :)

-John E. / TDM