Author Topic: Changing MinGW compiler, which ships with C::B  (Read 51395 times)

Offline eXpl0it3r

  • Multiple posting newcomer
  • *
  • Posts: 13
Changing MinGW compiler, which ships with C::B
« 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 for SFML and 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.

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...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Changing MinGW compiler, which ships with C::B
« Reply #1 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline eXpl0it3r

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Changing MinGW compiler, which ships with C::B
« Reply #2 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Changing MinGW compiler, which ships with C::B
« Reply #3 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Changing MinGW compiler, which ships with C::B
« Reply #4 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline eXpl0it3r

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Changing MinGW compiler, which ships with C::B
« Reply #5 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 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Changing MinGW compiler, which ships with C::B
« Reply #6 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?

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline eXpl0it3r

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Changing MinGW compiler, which ships with C::B
« Reply #7 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Changing MinGW compiler, which ships with C::B
« Reply #8 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.
« Last Edit: August 09, 2013, 04:46:01 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Changing MinGW compiler, which ships with C::B
« Reply #9 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline eXpl0it3r

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Changing MinGW compiler, which ships with C::B
« Reply #10 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.
« Last Edit: August 09, 2013, 04:25:29 pm by eXpl0it3r »

Offline huzhongshan

  • Multiple posting newcomer
  • *
  • Posts: 109
Re: Changing MinGW compiler, which ships with C::B
« Reply #11 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.

Offline eXpl0it3r

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Changing MinGW compiler, which ships with C::B
« Reply #12 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. ;)

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Changing MinGW compiler, which ships with C::B
« Reply #13 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
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline eXpl0it3r

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Changing MinGW compiler, which ships with C::B
« Reply #14 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
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.