Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: TDragon on June 08, 2010, 05:35:54 am

Title: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: TDragon on June 08, 2010, 05:35:54 am
The post below refers to a previous release of TDM-GCC. For the announcement of the latest release, see this post (http://forums.codeblocks.org/index.php/topic,12701.msg96999.html#msg96999).



Greetings!

TDM-GCC 4.5.0 is now available!
TDM-GCC finally returns with even more goodness packed into one easy-to-use Windows installer.

The TDM release of GCC 4.5.0 is now available for download. As always, I've tested it on wxWidgets (2.8.11) and Code::Blocks SVN (6298) to ensure good compatibility. Among other patches, I've *reversed* the GCC change that caused an out-of-memory problem building wxWidgets due to the forced emission of class inline functions in DLL code. This means you shouldn't have to perform any unusual steps when building wxWidgets.

The most important feature is a new edition of TDM-GCC:
Along with the classic MinGW 32-bit edition, a new TDM64 edition is also available. This edition is based on the MinGW-w64 runtime API and the x86_64-w64-mingw32 GCC target, and can create both 32-bit and 64-bit code, with the "-m32"/"-m64" compiler flags. Please be aware, if you build Code::Blocks yourself, that it only works as 32-bit code ("-m32") on Windows, currently -- though that will hopefully change soon. Also, please never mix 32-bit object files (.o), libraries (.a), DLLs, or EXEs with 64-bit versions, and don't report it as a bug if you inadvertently do.

More information and downloads are available at <http://tdm-gcc.tdragon.net/ (http://tdm-gcc.tdragon.net/)>. TDM-GCC includes support for C, C++, Fortran, Objective-C/C++, and Ada (MinGW edition only), as well as support for the OpenMP multithreading extensions, packaged in a simple Windows installer.

Disclaimer:
As always, please remember:

Cheers,
John E. / TDM
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: ollydbg on June 08, 2010, 05:57:07 am
Thanks John.
Very nice work and I found your tdb-gcc website has a new frame.  :D
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: MortenMacFly on June 08, 2010, 07:04:56 am
TDM-GCC 4.5.0 is now available!
THANKS, thanks thanks!
I like the C::B logo on your page btw... ;-)
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: killerbot on June 08, 2010, 07:29:39 am
As always : thank you very much, you are the best.


Question : is the level of c++0x support the same as in the linux gcc versions ?
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: killerbot on June 08, 2010, 08:48:58 am
Just to be sure if all this is intended.

The download links for 32 bit and 64 bit both take me to the same file, at least a file with the same name (and after download equal size).
The name of the downloaded file is : tdm-mingw-1.908.0-4.4.1-2.exe

Questions :
- shouldn't there be 2 different installers (with different names, to clearly make the distinction 32 bit versus 64 bit) ?
- how come still the reference in the name to 4.4.1 ?
- or am I getting incorrect download links ?

Cheers
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: ptDev on June 08, 2010, 09:16:43 am
Greetings!

TDM-GCC 4.5.0 is now available!

...

Among other patches, I've *reversed* the GCC change that caused an out-of-memory problem building wxWidgets due to the forced emission of class inline functions in DLL code.
...

Thank you so much!!! :D
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: killerbot on June 08, 2010, 04:49:10 pm
if on sourceforge you ask the list of all files you can find these 2 :

tdm-gcc-4.5.0.exe           27.2 MB     2010-06-08     44     
tdm64-gcc-4.5.0.exe       26.4 MB    2010-06-08    7
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: TDragon on June 08, 2010, 05:20:15 pm
I botched the download links on the website, sorry. Now fixed.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: TDragon on June 08, 2010, 05:32:16 pm
Question : is the level of c++0x support the same as in the linux gcc versions ?
Almost but not quite. Support for std::thread currently relies on POSIX threads in libstdc++, which will require a configuration change at least. I haven't tried it yet. Most other C++0x features should work.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: Loaden on June 08, 2010, 06:38:40 pm
WoWoW...cool!
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: oBFusCATed on June 08, 2010, 08:44:35 pm
Almost but not quite. Support for std::thread currently relies on POSIX threads in libstdc++, which will require a configuration change at least. I haven't tried it yet. Most other C++0x features should work.
hm, std::thread is implemented in 4.5.0... ah, it is not listed on the c++-0x status page...
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: TDragon on June 08, 2010, 09:50:46 pm
Try the libstdc++ status page (http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#id476343).
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: UsYer on June 08, 2010, 10:03:42 pm
Hi,
just one question. Is lto enabled in your build? Because as I tried it with the -lto switch I encounter this error :"cc1plus.exe: error: LTO support has not been enabled in this configuration"
Tanks in advance
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: TDragon on June 09, 2010, 12:42:49 am
You've answered your own question. I may attempt to enable it in a future build.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: UsYer on June 09, 2010, 07:36:06 am
Okay, thanks for your answer. I thought that there could have been another switch or something which i forgot to turn on.
Anyway, I'm really appreciating your work and I hope there will be a lto enabled version in the future.

regards
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: AlisdairM on June 09, 2010, 11:29:15 pm
I am currently implementing my own C++0x standard library, using all the 0x features from the ground up.  For instance, 0x is supposed to solve a number of syntax inconsistencies by allowing brace-initialization *everywhere*, so this is the only initialization I use. Likewise, I am exclusively using the new function syntax, and the new type-alias syntax once it becomes available.  Many of the template tricks that earlier libraries relied on will no longer be necessary, so I get cleaner code.

Why do I mention this?  So far I have been doing all that development using TDM GCC and CodeBlocks <g>.
As it happens, I just migrated to the mac so get easier access to the 4.6 preview builds, but GCC 4.5 is full of 0x goodness, and you can go a long way with this now.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: thomas on June 10, 2010, 12:30:40 am
TDM-GCC finally returns with even more goodness packed into one easy-to-use Windows installer.
Which finally means that there is a gcc 4.5 build that doesn't suck ass. Or in other words, one that doesn't fail to build 80% of your stuff (have to wonder why the original MinGW team can't do that...).
Thank you, John. You rule :)
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: TDragon on June 10, 2010, 02:38:20 pm
My fondest wish is for the official MinGW releases to someday negate the benefits of TDM-GCC... but until that day comes, you're welcome.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: stefanos_ on June 10, 2010, 09:42:36 pm
TDragon, I have tdm-mingw-1.908.0-4.4.1-2.exe installed on my system and I would like to upgrade to the latest version tdm-gcc-4.5.0.exe. I have downloaded first the on demand installer and didn't give me the option to upgrade the existing installation.

I then downloaded the bundled edition and tried the same thing; it cannot detect the installed directory.

What shall I do? Shall I uninstall the old version and install the new one? Should not there be an upgrade method for old versions to the latest ones? Shall it be a future request? I think it should be an automated process with less than 2-3 clicks, not a whole install-uninstall process.

Please advice.

Cheers and keep up the good work.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: TDragon on June 10, 2010, 10:30:02 pm
Ah, my apologies. Though it's not at all obvious, I've made changes to the installation system such that a 4.5.0 installation and a 4.4.1 installation are recognized differently. Therefore, although I intend for most upgrade scenarios to work as you say, this one won't. You will need to uninstall 4.4.1 first if you want to place 4.5.0 in the same location.

Future upgrades should work as expected. Again, I apologize for the breakage.
-John E. / TDM
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: stefanos_ on June 10, 2010, 10:42:12 pm
Thank you very much for your reply. I am pretty sure that others as well, will experience the same situation and they will ask for the same thing.

If I may, I would suggest you point that out to either your website as a notification, or to Code::Blocks's forum as a separate sticky announcement.

Thanks for once again.

stefanos_
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: thomas on June 11, 2010, 05:02:03 pm
Hmm... seems I was a little bit too enthusiastic :(

With gcc 4.5, I'm now getting this in one of my projects:
In file included from z:\gcc45\bin\../lib/gcc/mingw32/4.5.0-dw2/include/c++/cmath:629:0,
                 from [...]/mingw32/4.5.0-dw2/include/c++/random:38,
                 from [...]/mingw32/4.5.0-dw2/include/c++/bits/stl_algo.h:66,
                 from [...]/mingw32/4.5.0-dw2/include/c++/algorithm:63,
                 from [...]:
[...]/4.5.0-dw2/include/c++/tr1_impl/cmath:147:11: error: '::double_t' has not been declared
[...]/4.5.0-dw2/include/c++/tr1_impl/cmath:148:11: error: '::float_t' has not been declared


Unluckily, I can't seem to reproduce it in a simple Hello World project (compiles just fine when I try there!). If I typedef float_t and double_t before including <algorithm>, the error is fixed.

Windres reports a syntax error on a RC file which is 100% good (can work around by using the previous version's binary).

And finally: [...]/4.5.0-dw2/../../../crt2.o:crt1.c:(.text+0x28): undefined reference to `__dyn_tls_init_callback' is where I gave up. Note that I'm not using any TLS at all, at least not consciously -- maybe OpenAL does behind my back :)
It might be noteworthy to tell that the same, identical project compiles its 974 files with a total of 3 warnings (two are a unused parameter in a callback function, and the third comes from using a MSVC import library) under gcc 4.4 with pretty much every available warning turned on.

Seems with gcc 4.5 we're still a bit too deep in alpha stage. Still, your build gets much closer to "successful" than the original MinGW build, which emits about 1500 warnings and 50 errors before bailing out, most of which are totally obscure (and which I honestly didn't bother to look at further), and some of which are related to Graphite not being compiled in.
So, still, great work :)
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: TDragon on June 11, 2010, 07:25:18 pm
And finally: [...]/4.5.0-dw2/../../../crt2.o:crt1.c:(.text+0x28): undefined reference to `__dyn_tls_init_callback' is where I gave up. Note that I'm not using any TLS at all, at least not consciously -- maybe OpenAL does behind my back :)
This happens when you have an older installation in X:\MinGW (or when not all object files have been rebuilt with the new GCC). Per the README and the Getting Started installation notes, GCC currently searches "/mingw" no matter what, so if you have multiple installations you can't have one there. I will *probably* change this in the next release, although it will mean a further departure from GNU standards.

If you can send me an RC file that should work and doesn't, I can downgrade the installer default to the previous binutils release and try to make sure it gets fixed for the next one.

Finally, if you're interested in installing the TDM64 edition, I'd be interested to see if you got the same errors using that edition and "-m32".

-John E. / TDM
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: thomas on June 13, 2010, 02:15:58 am
This happens when you have an older installation in X:\MinGW (or when not all object files have been rebuilt with the new GCC).
My installations are Z:\gcc44 and Z:\gcc45, respectively. The installations share a folder that holds the OpenGL, OpenAL, Ogg, Vorbis includes (made available to the compiler via the -I flag, which should be legitimate). Rebuild was done by hitting the "clean rebuild" button in c::b which hopefully should sufficiently erase everything. So, hmm... not sure what's wrong then.

Quote
If you can send me an RC file that should work and doesn't
Will see to that on monday (not at that machine now).

Quote
Finally, if you're interested in installing the TDM64 edition
Generally intersted yes, but unluckily no Windows 64 system here (only Linux 64, though maybe Wine may be worth trying?).
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: TDragon on June 13, 2010, 03:21:43 am
This happens when you have an older installation in X:\MinGW (or when not all object files have been rebuilt with the new GCC).
My installations are Z:\gcc44 and Z:\gcc45, respectively. The installations share a folder that holds the OpenGL, OpenAL, Ogg, Vorbis includes (made available to the compiler via the -I flag, which should be legitimate). Rebuild was done by hitting the "clean rebuild" button in c::b which hopefully should sufficiently erase everything. So, hmm... not sure what's wrong then.
Odd. If you feel like sending me the link command line I might see if I can figure it out and/or reproduce it.

Quote
Quote
Finally, if you're interested in installing the TDM64 edition
Generally intersted yes, but unluckily no Windows 64 system here (only Linux 64, though maybe Wine may be worth trying?).
You can run the TDM64 edition on a 32-bit machine; although the compiler can generate 64-bit code, it's built as 32-bit binaries.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: stefanos_ on June 13, 2010, 04:21:45 pm
Hello TDragon.

I think I have found a bug. While I was working on a certain example from a book of mine, I have discovered a bug regards to istream_iterator.

The code I used is this:

Code
// ioiter1.cpp
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

int main()
{
    using namespace std;    // all symbols in std are global

    vector<string> coll;    // vector container for strings

    /* read strings from the standard input up until the end of the data
     * - copy from the 'input collection' cin, inserting into coll
     */
    copy(istream_iterator<string>(cin),     // start of source range
         istream_iterator<string>(),        // end of source range
         back_inserter(coll));              // destination range

    // sort elements in coll
    sort(coll.begin(), coll.end());

    /* output all elements
     * - copy from coll to the 'output collection' cout
     * - every string on its own line (separated by "\n")
     */
    copy(coll.begin(), coll.end(),              // source range
         ostream_iterator<string>(cout, "\n")); // destination range
}


A special thanks goes to Nicolai M. Josuttis, author of book Object-Oriented Programming in C++, for composing such an amazing book.

The error report by compiler is this:

C:\Projects\Josuttis_OOP\Chapter_03\17. IOiter1\ioiter1.cpp||In function 'int main()': |
C:\Projects\Josuttis_OOP\Chapter_03\17. IOiter1\ioiter1.cpp|16|error: 'istream_iterator' was not declared in this scope|
C:\Projects\Josuttis_OOP\Chapter_03\17. IOiter1\ioiter1.cpp|16|error: expected primary-expression before '>' token|
C:\Projects\Josuttis_OOP\Chapter_03\17. IOiter1\ioiter1.cpp|17|error: expected primary-expression before '>' token|
C:\Projects\Josuttis_OOP\Chapter_03\17. IOiter1\ioiter1.cpp|17|error: expected primary-expression before ')' token|
C:\Projects\Josuttis_OOP\Chapter_03\17. IOiter1\ioiter1.cpp|28|error: 'ostream_iterator' was not declared in this scope|
C:\Projects\Josuttis_OOP\Chapter_03\17. IOiter1\ioiter1.cpp|28|error: expected primary-expression before '>' token|
C:\Projects\Josuttis_OOP\Chapter_03\17. IOiter1\ioiter1.cpp|28|warning: left-hand operand of comma has no effect|
||=== Build finished: 6 errors, 1 warnings ===|


I have pastebin-ed the current code and asked for help from Freenode's #C++-basic and tested it on Codepad (http://codepad.org) and compiled just fine.

Can you please test this code with your 4.5.0 version and provide me your feedback? That would be greatly appreciated.

I'm waiting for anyone's reply.

Regards,

stefanos_
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: oBFusCATed on June 13, 2010, 04:27:23 pm
stefanos_: Have you tried to include <iterator> ?

In gcc 4.5.0 the standard conformance is improved and the c++ standard says (I think),
that if you use something from the std namespace you should include the header, where it has been defined.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: killerbot on June 13, 2010, 04:37:29 pm
istream_iterator  --> you need to include <iterator>.

So the code is wrong. By the way, I somewhat remember that in Josuttis STL book (which is GREAT), there were also includes missing. So always be careful with book examples, because most of the time the author was focusing on something different and didn't most probably pay attention if all includes are OK (or ensure there are no memory leaks), they also copy paste from one example to another ;-)
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: stefanos_ on June 13, 2010, 06:27:42 pm
Thank you both for your replies.

I just found the book's errata file and indeed, a missing iterator header was causing the whole thing to fall apart.

Fortunately we always have the chance with trial and error to resolve dummy "issues" like this :D

Thanks for once again.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: Andrej08 on June 13, 2010, 08:14:08 pm
Thanks a bunch, TDragon!

I've just compiled wxWidgets & CB 30 mins ago, with no issues. Good job on TDM!
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: thomas on June 14, 2010, 12:11:21 pm
...
Odd. If you feel like sending me the link command line I might see if I can figure it out and/or reproduce it.
Well, that was just plain stupid. For some reason I've had the lib folder belonging to TDM-gcc4.4 in path.

The issue with broken <algorithm> went away "magically" too by deleting the installation folder and installing anew.

Project now builds just fine under gcc 4.5, sorry about complaining too early :)

Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: thomas on June 14, 2010, 03:45:03 pm
Hmm... but I found a real bug too :)

This code snippet is supposed to work fine and indeed does work fine with gcc 4.4 as well as gcc 4.5 non-optimized.
However, it crashes in optimized build. #pragma GCC optimize ("-O0") immediately preceding the function prevents crash. It appears that the compiler wrongly "optimizes out" the variable sizeReq and uses nullptr as its memory address.

Code
DynamicLibrary iphlpapi("iphlpapi.dll");

if(iphlpapi)
{
typedef DWORD (WINAPI *GetIfTable_t)(PMIB_IFTABLE,PULONG,BOOL);
GetIfTable_t GetIfTable_fun = iphlpapi.GetSymbol("GetIfTable");

if(!GetIfTable_fun) // be sure funcptr is valid
return;

PMIB_IFTABLE pInfo = 0;
DWORD sizeReq = 0;

// supplying a zero-size buffer returns ERROR_INSUFFICIENT_BUFFER
// and writes the required buffer size to sizeReq
GetIfTable_fun(0, &sizeReq, 0); // crashes writing to address 0x00000000, i.e. &sizeReq == nullptr

// now reserve the correct size
pInfo = (PMIB_IFTABLE) alloca(sizeReq);

// and finally, go for the real thing
if(GetIfTable_fun(pInfo, &sizeReq, 0) == NO_ERROR )
{
for(...)
...
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: TDragon on June 14, 2010, 07:07:05 pm
Yep, definitely looks like a case of faulty optimization. If you feel like submitting the source as a test case, I'll make sure it hits GCC Bugzilla.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: billyonthemountain on June 14, 2010, 11:08:01 pm
thanks for this much awaited release John !  :D

You can run the TDM64 edition on a 32-bit machine; although the compiler can generate 64-bit code, it's built as 32-bit binaries.

Any plans to make a native 64bit version ? (not that it matters that much...)

Also Loaden mentions on his google code page (http://code.google.com/p/qp-gcc/) :
Quote
What's the disadvantages of MinGW TDM 4.4.1
1. It doesn't have the official MinGW patches included.

Which patches is he mentioning and is it still valid for 4.5.0 ?

Best regards,
Billy
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: TDragon on June 14, 2010, 11:21:48 pm
Any plans to make a native 64bit version ? (not that it matters that much...)
Not until Windows stops supporting 32-bit programs.

Quote
Also Loaden mentions on his google code page (http://code.google.com/p/qp-gcc/) :
Quote
What's the disadvantages of MinGW TDM 4.4.1
1. It doesn't have the official MinGW patches included.

Which patches is he mentioning and is it still valid for 4.5.0 ?
I haven't the foggiest, and I believe the official MinGW 4.5.0 release is unpatched.

-John E. / TDM
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: thomas on June 14, 2010, 11:27:11 pm
Yep, definitely looks like a case of faulty optimization. If you feel like submitting the source as a test case, I'll make sure it hits GCC Bugzilla.
Once burnt, twice shy :) I once submitted a bug to Subversion and later found that they published my bug report including my mail address on a publicly accessible site where every spambot would find it. Which, in turn, makes me reluctant to ever do a similar thing again, hehehe :)
But, feel free to submit the snippet, if you like.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: TDragon on June 15, 2010, 12:11:55 am
I can't reproduce this with the snippet. What I mean is, if you can provide me with enough of the source file to reproduce the problem in assembly, I can either create a patch myself or submit a formal testcase to GCC Bugzilla myself.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: thomas on June 15, 2010, 04:02:49 pm
I've tried putting the full function with the accompanying DynamicLibrary class in a new project that just calls the function from main() and nothing else. Unluckily, no optimizing crash in that case. Sending you the complete project that produces the bug is not possible, sadly.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: sankarbose on June 15, 2010, 08:59:05 pm
Hi
i have just downloaded  TDM-GCC 4.5.0 and successfully compiled the apache xerces but i cant run any example programs it gives a error
  " The application failed to initialize properly (0xc0000005). click ok to terminate the application ".
 In the msys shell i received some massages like auto import enabled without --enable-auto-import specified.
please help me , i am a newbie and i have a little knowledge in gcc and mingw.

                                      with regards.............
  
 

              
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: reckless on June 15, 2010, 10:44:51 pm
hmm 0xc0000005 = access violation error. seems the code produced tries to write to an area in memory which is protected.

this is also one of the buggers im hunting a bit on mingw's java parts. the weird thing is its totally random but even when the affected executables dont show this the thing will still crash.

one of the main culprits i found where when using crossbuilt libraries (especially if built on linux for win32) one being libgnurx, i rebuilt it on windows and the problem went away.

the auto import thingy is just ld telling you that it uses auto import to satisfy all dependencies (dont worry about that) warning != will not run.

as for the access violation error i cant help much there im afraid would have to try the same code you used and see if it crashes here also.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: sankarbose on June 15, 2010, 11:37:51 pm
Hi reckless
 
the programs, i am trying to run is from the sample dir of xerces and i am using windows xp sp2.
the message i received in msys is
Quote
auto-importing has been activated without --enable-auto-import specified on the
 command line.
This should work unless it involves constant data structures referencing symbols
 from auto-imported DLLs.
i have also tried the files from mingw.org but it still gives the same error.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: TDragon on June 15, 2010, 11:55:18 pm
sankarbose, I will upgrade the TDM-GCC installer to the latest binutils release soon, which should fix your problem. In the meantime, try adding '-Wl,--enable-runtime-pseudo-reloc-v2' to the link command line.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: reckless on June 16, 2010, 12:19:57 pm
might explain why it works here my binutils where patched to allways use runtime-pseudo-reloc-v2 as default.

xerces examples work with that.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: billyonthemountain on June 17, 2010, 10:50:29 am
Ok here some results of me trying to build wxWidgets on Windows 7 x64 (cmd line) :
Code
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1


The flags used were (here part of the config.gcc for the failed 2nd try):
Code
# Standard flags for CC 
CFLAGS ?= -pipe -march=core2 -m32 -floop-interchange -floop-strip-mine -floop-block

# Standard flags for C++
CXXFLAGS ?= -pipe -march=core2 -m32 -floop-interchange -floop-strip-mine -floop-block

# Standard preprocessor flags (common for CC and CXX)
CPPFLAGS ?=

# Standard linker flags
LDFLAGS ?= -Wl,--as-needed -m32

the -m32 switch was replaced by -m64 in the 1st try and by nothing in the 3rd.

Here the error message for the 2nd try:
Code
[...]
g++ -shared -fPIC -o ..\..\lib\gcc_dll\wxmsw28u_gcc_custom.dll gcc_mswudll\monod
ll_dummy.o gcc_mswudll\monodll_version_rc.o gcc_mswudll\monodll_appbase.o gcc_ms
wudll\monodll_arcall.o gcc_mswudll\monodll_arcfind.o gcc_mswudll\monodll_archive.o [many more *.o files...]
Creating library file: ..\..\lib\gcc_dll\libwxmsw28u.a
c:/mingw64-tdm/bin/../lib/gcc/x86_64-w64-mingw32/4.5.0/../../../../x86_64-w64-mi
ngw32/bin/ld.exe: i386:x86-64 architecture of input file `gcc_mswudll\monodll_ve
rsion_rc.o' is incompatible with i386 output
collect2: ld returned 1 exit status
mingw32-make: *** [..\..\lib\gcc_dll\wxmsw28u_gcc_custom.dll] Error 1

Any hints at what I might have missed there or why Mingw64 can't build correctly wxWidgets in 32 bit mode ?

edit: I tried again with only minimal flags (ie. no graphite, no march, no as-needed, no pipe) but it still fails in the same way...
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: billyonthemountain on June 17, 2010, 02:52:57 pm
The same happens when building the src target of codeblocks :

Code
x86_64-w64-mingw32-g++.exe -Lbase\tinyxml -LD:\lib\wxWidgets-2.8.10\lib\gcc_dll -Ldevel  -o devel\codeblocks.exe .objs\src\app.o .objs\src\appglobals.o .objs\src\associations.o .objs\src\compilersettingsdlg.o .objs\src\crashhandler.o .objs\src\dlgabout.o .objs\src\dlgaboutplugin.o .objs\src\environmentsettingsdlg.o .objs\src\infopane.o .objs\src\main.o .objs\src\notebookstyles.o .objs\src\printdlg.o .objs\src\scriptconsole.o .objs\src\scriptingsettingsdlg.o .objs\src\splashscreen.o .objs\src\startherepage.o .objs\src\switcherdlg.o  .objs\src\resources\resources.res  -Wl,--enable-auto-import -mthreads -Wl,--as-needed -m32  -lcodeblocks -lwxscintilla -lwxpropgrid -lshfolder -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lcomctl32 -lodbc32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lwxmsw28u  -mwindows
c:/mingw64-tdm/bin/../lib/gcc/x86_64-w64-mingw32/4.5.0/../../../../x86_64-w64-mingw32/bin/ld.exe: i386:x86-64 architecture of input file `.objs\src\resources\resources.res' is incompatible with i386 output
collect2: ld returned 1 exit status
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: TDragon on June 17, 2010, 03:36:30 pm
For wxWidgets, I added RCFLAGS to makefile.gcc per the attached patch and then added RCFLAGS="-F pe-i386" to the wxWidgets make command. This is the equivalent of "-m32" for windres, the resource compiler.

For Code::Blocks, there is no RCFLAGS equivalent so I had to use a custom build command for the .rc files: $rescomp -F pe-i386 -i $file -J rc -o $resource_output -O coff $res_includes

[attachment deleted by admin]
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: billyonthemountain on June 17, 2010, 07:28:52 pm
Thanks, it works correctly now... both wx and C::B :)
There one issue remaining :
In the binutils bundled with the mingw64/multilib version, the strip utility doesn't accept wildcards but the mingw32 one does, which can be problematic when running the update.bat script... An easy workaround is of course to keep a copy of that 2nd strip.exe somewhere in the PATH, but not really elegant...  :?
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: sankarbose on June 17, 2010, 09:43:57 pm
might explain why it works here my binutils where patched to allways use runtime-pseudo-reloc-v2 as default.

xerces examples work with that.
can you tell me how should i do it ??
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: reckless on June 18, 2010, 07:02:34 am
LDFLAGS="-Wl,--enable-runtime-pseudo-reloc-v2".

the l is not a 1 (lowercase L) that one had me stomped for a while  :lol:
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: sankarbose on June 19, 2010, 08:01:20 am
Hi reckless
thanks for the answer but i like to know where should i add the ld flag so that it uses the --enable-runtime-pseudo-reloc-v2 option all the time ?
 is it in the ldscripts files if yes where should i add the line ?
Quote
the l is not a 1 (lowercase L) that one had me stomped for a while  Laughing
Ha ha i had also quite a Time with this one. :lol:
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: reckless on June 19, 2010, 08:57:15 am
got the patch from here http://195.135.221.130/pub/opensuse/repositories/windows:/mingw:/win32/openSUSE_Factory/src/ (http://195.135.221.130/pub/opensuse/repositories/windows:/mingw:/win32/openSUSE_Factory/src/) you need to rebuild binutils with the patch in there binutils src rpm, but tbh its just as easy just doing LDFLAGS="-Wl,--enable-runtime-pseudo-reloc-v2" ./configure --blah and you might run into problems with other stuff with runtime pseudo relocation allways on.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: Max on June 19, 2010, 05:13:27 pm
I have two questions about the latest TDM GCC (4.5.0)

1) In the download page the 32 bit binutils is linked to the 2.20.1 version. The 64 bit version is linked to the latest 2.20.51 instead. Becasue the 2.20.51 is enable the pseudo-reloc-v2  by default I'm wondering why the 32 bit is still using the old one. Is there any reason for that?

2) I'm using the TDM-GCC 4.4.1 but I'm getting trouble throwing an exception from a thread and catching it in another thread. My understanding is that the exception mechanism is not thread safe in 4.4.1. Is this bug fixed in the 4.5.0 (that is really using TLS now). This bug is the only reason that is pushing me to upgrade. So I need to know if 4.5.0 has a a thread safe exception handling.

Thx

max
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: reckless on June 19, 2010, 07:06:56 pm
might just not have been updated yet, mingw64 is normally heaps and bounds ahead of normal mingw in implementing new tech.

and gcc-4.5.0 supports thread local storage, how stable it is i cant vote for though but it works ok here :)
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: TDragon on June 19, 2010, 09:54:21 pm
1) In the download page the 32 bit binutils is linked to the 2.20.1 version. The 64 bit version is linked to the latest 2.20.51 instead. Becasue the 2.20.51 is enable the pseudo-reloc-v2  by default I'm wondering why the 32 bit is still using the old one. Is there any reason for that?
For the 32-bit edition I elect to provide only GCC's own binaries and use the MinGW project's official releases for the other packages. At the time that TDM-GCC 4.5.0 was released, the latest MinGW binutils release was 2.20.1. A newer version has since been released, and as soon as I'm convinced it has no severe regressions, I'll update the links and the installer.

Quote
2) I'm using the TDM-GCC 4.4.1 but I'm getting trouble throwing an exception from a thread and catching it in another thread. My understanding is that the exception mechanism is not thread safe in 4.4.1. Is this bug fixed in the 4.5.0 (that is really using TLS now). This bug is the only reason that is pushing me to upgrade. So I need to know if 4.5.0 has a a thread safe exception handling.
All recent TDM-GCC releases have been tested to work correctly throwing exceptions within threads, but trying to throw an exception in one thread and catch it in another is just asking for trouble, particularly as Windows has no concept of a true "joinable" thread. You should instead catch the exception in your thread function, convert it to heap memory if it isn't there already, and transfer it to your other thread via some synchronization function.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: keke on June 21, 2010, 09:15:19 pm
I'm trying to build TDM-GCC 4.5.0 32 bits from the sources using the provided makefile and scripts. I think I correctly followed the instructions but I'm stuck somewhere (during the compilation of the ppl lib I think). It says:

Code
/bin/sh ../libtool --tag=CXX   --mode=link g++  -g -O2 -frounding-math -O2 -I/cr
ossdev/support-stage-tdm32/gmp/include -W -Wall  -version-info 8:0:1 -no-undefin
ed -s -L/crossdev/support-stage-tdm32/gmp/lib -o libppl.la -rpath /crossdev/supp
ort-stage-tdm32/ppl/lib Box.lo checked.lo Checked_Number.lo Float.lo fpu-ia32.lo
 Constraint.lo Constraint_System.lo Congruence.lo Congruence_System.lo Generator
_System.lo Grid_Generator_System.lo Generator.lo Grid_Generator.lo Init.lo Coeff
icient.lo Linear_Expression.lo Linear_System.lo Matrix.lo Scalar_Products.lo MIP
_Problem.lo Poly_Con_Relation.lo Poly_Gen_Relation.lo BHRZ03_Certificate.lo H79_
Certificate.lo Grid_Certificate.lo Polyhedron_nonpublic.lo Polyhedron_public.lo
Polyhedron_chdims.lo Polyhedron_widenings.lo C_Polyhedron.lo NNC_Polyhedron.lo G
rid_nonpublic.lo Grid_public.lo Grid_chdims.lo Grid_widenings.lo BD_Shape.lo Oct
agonal_Shape.lo Pointset_Powerset.lo Row.lo Linear_Row.lo Bit_Matrix.lo Bit_Row.
lo Ph_Status.lo Grid_Status.lo Variable.lo Variables_Set.lo conversion.lo minimi
ze.lo simplify.lo Grid_conversion.lo Grid_simplify.lo stdiobuf.lo c_streambuf.lo
 globals.lo mp_std_bits.lo version.lo    wrap.lo -lm -lgmpxx -lgmp
/bin/grep: /mingw/lib/gcc/mingw32/4.5.0/libstdc++.la: No such file or directory
/bin/sed: can't read /mingw/lib/gcc/mingw32/4.5.0/libstdc++.la: No such file or
directory
libtool: link: `/mingw/lib/gcc/mingw32/4.5.0/libstdc++.la' is not a valid libtoo
l archive
make[4]: *** [libppl.la] Error 1
make[4]: Leaving directory `/crossdev/build/ppl-tdm32/src'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/crossdev/build/ppl-tdm32/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/crossdev/build/ppl-tdm32'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/crossdev/build/ppl-tdm32'
make: *** [ppl] Error 2

I see it can't find libstdc++.la but according to the building instructions  (unless I didn't understand them correctly) provided in the TDM release, /mingw should be empty at this point. Then it's normal it can't find libstdc++.la in this path.

Any Idea?

Thanks
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: TDragon on June 21, 2010, 11:07:20 pm
No, I've never seen that error before.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: keke on June 22, 2010, 12:52:23 pm
@TDragon:

Is /mingw/lib/gcc/mingw32/4.5.0/libstdc++.la supposed to exist at this point of the building process or not?
If I understand the instructions correctly /mingw should be empty before I start the script.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: a14331990 on June 22, 2010, 02:08:03 pm
Is the patch auto-import.diff from dave korn (and slightly modified by me) already applied?
Have a look at here.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43601
This patch will enable auto-import by default in binutils and works well.
Best Regards.
a14331990 a.k.a Leo  
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: TDragon on June 22, 2010, 08:05:59 pm
It shouldn't matter whether or not there is a MinGW installation in /mingw when you build the dependencies. I've done it both ways myself. Again, I have no idea why you would be seeing that error.

To be clear, I have even less time to support building GCC from source than I have to support the use of the TDM-GCC binaries. Building non-Windows-specific software from source, particularly GCC, is *not* a straightforward process on Windows. It requires a lot of trial and error, stubbornness, and the willingness to dig as deeply as necessary into the sources to figure out the problem yourself. Don't expect much help from me.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: thomas on July 08, 2010, 02:07:46 pm
Quote
cc1plus.exe: error: LTO support has not been enabled in this configuration
Any chance for that to happen in a future release, pretty please? :)
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: TDragon on July 08, 2010, 02:51:06 pm
I may attempt to enable it in a future build.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: a14331990 on August 05, 2010, 03:59:57 am
Have a look at gcc 4.5.1 changelog.
Quote
All languages

GCC's new link-time optimizer (-flto) now also works on a few non-ELF targets:
Cygwin (*-cygwin*)
MinGW (*-mingw*)
Darwin on x86-64 (x86_64-apple-darwin*)

LTO is not enabled by default for these targets. To enable LTO, you should configure with the --enable-lto option.

I have successfully built gcc 4.5.1 on MinGW platform, look at this thread for details
Leo's Build of MinGW GCC 4.5.1 Released
http://forums.codeblocks.org/index.php/topic,13046.0.html

dll linking and lto are all ok. :)

Best Regards.
a14331990 a.k.a Leo.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: ironhead on August 12, 2010, 02:30:10 pm
I don't know if I'm missing something, but when I try to link against libstdc++.dll with the 64-bit builds, I'm still getting the symbols from libstdc++.a.  As per the mingw-w64 instructions, I'm compiling with '-D_GLIBCXX_DLL'  and linking with '-shared-libgcc' along with '-lstdc++.dll'.

Any help would be greatly appreciated, thank you.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: TDragon on August 12, 2010, 02:50:52 pm
Change "-lstdc++.dll" to "-shared-libstdc++".

There is a note to this effect under "Exceptions and DLLs" in the TDM-GCC README. This is a fairly substantive reversal with respect to vanilla GCC sources, however, so it could probably stand to be made a bit clearer.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: ironhead on August 12, 2010, 05:46:48 pm
Change "-lstdc++.dll" to "-shared-libstdc++".

Much better thank you!
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: ironhead on August 12, 2010, 07:42:04 pm
One more question...  I'm trying to build wxWidgets 2.8.11 using the 64-bit binaries and I'm hitting a snag:

Code
../../src/msw/thread.cpp: In static member function 'static THREAD_RETVAL wxThreadInternal::DoThreadStart(wxThread*)':
../../src/msw/thread.cpp:525:43: error: cast from 'void*' to 'THREAD_RETVAL' loses precision
../../src/msw/thread.cpp: In member function 'wxThreadError wxThreadInternal::WaitForTerminate(wxCriticalSection&, void**, wxThread*)':
../../src/msw/thread.cpp:845:21: error: cast from 'void*' to 'DWORD' loses precision
../../src/msw/thread.cpp: In member function 'void wxThread::Exit(void*)':
../../src/msw/thread.cpp:1165:28: error: cast from 'void*' to 'unsigned int' loses precision
make: *** [gcc_mswudll\monodll_thread.o] Error 1

I'm using the Code::Blocks build instructions:

Code
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: stahta01 on August 12, 2010, 08:23:05 pm
@ironhead:

wxWidgets 2.8 is NOT 64 bit compatible under Windows.

Tim S.
Title: Re: TDM-GCC 4.5.0 32- and 64-bit editions released
Post by: ironhead on August 12, 2010, 08:57:40 pm
wxWidgets 2.8 is NOT 64 bit compatible under Windows.

That would explain it.
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: TDragon on September 02, 2010, 06:09:31 am
Greetings!

TDM-GCC 4.5.1 is now available!
The latest release of TDM-GCC incorporates GCC 4.5.1 in 32-bit and 32/64-bit editions, and includes LTO support.

The TDM release of GCC 4.5.1 is now available for download. As always, I've tested it on wxWidgets (2.8.11) and Code::Blocks SVN (6564) to ensure good compatibility.



WARNING!
In the TDM64 edition, a widespread change has been introduced that affects compatibility with previous versions. In summary, for the x86_64-w64-mingw32 target, symbol names WILL NOT, by default, have an additional underscore affixed, as was previously the case for this target (and remains the case for 32-bit targets). This was done for better compatibility with Microsoft's compiler.
This means that you must recompile all code that was compiled with an older 64-bit edition of GCC!
If you fail to recompile any part of a self-contained module, or inadvertently mix code compiled by an older edition with code compiled by a newer edition, you will encounter undefined symbol errors. Consider yourself warned.

(If you truly must, you can revert to the previous underscoring rule with the "-fleading-underscore" command-line option -- but don't do this unless you really know what you're doing.)


TDM-GCC is available in TWO editions:
Along with the classic MinGW 32-bit edition, a new TDM64 edition is also available. This edition is based on the MinGW-w64 runtime API and the x86_64-w64-mingw32 GCC target, and can create both 32-bit and 64-bit code, with the "-m32"/"-m64" compiler flags. Please be aware, if you build Code::Blocks yourself, that it only works as 32-bit code ("-m32") on Windows, currently -- though that will hopefully change soon. Also, please never mix 32-bit object files (.o), libraries (.a), DLLs, or EXEs with 64-bit versions, and don't report it as a bug if you inadvertently do.

More information and downloads are available at <http://tdm-gcc.tdragon.net/ (http://tdm-gcc.tdragon.net/)>. TDM-GCC includes support for C, C++, Fortran, Objective-C/C++, and Ada (MinGW edition only), as well as support for the OpenMP multithreading extensions, packaged in a simple Windows installer.


Disclaimer:
As always, please remember:

Cheers,
John E. / TDM
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: ptDev on September 02, 2010, 09:41:08 am
Unfortunately, the bugs related to the optimizer (my templates code crashes on runtime) are still present :(
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: MortenMacFly on September 02, 2010, 09:01:17 pm
TDM-GCC 4.5.1 is now available!
Great news, as usual. What about the underscored in the fortran world? Because I've many code that actually adds the underscore when using C (C++) and Fortran together. Would that mean I don't need these patches anymore? ...I'll simply try... ;-)
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: TDragon on September 03, 2010, 03:45:58 am
MortenMacFly:
The underscoring change only affects 64-bit compilation. Your mileage may vary.

Everyone:
I've released patch 2 of the TDM64 runtime package which fixes a TDM-GCC-introduced bug in the inclusion of <float.h>.
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: ArbolOne on September 03, 2010, 03:55:39 pm
I just got a new Win7-64; I proceeded to download/install  TDM-GCC Compiler Suite for Windows, having done that I continued with the installation of CodeBlocks. I am currently trying to compile a simple "Hello" program, but to no avail. I get this error message:
======
"testingCB - Debug" uses an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]. Probably the toolchain path within the compiler options is not setup correctly?! Skipping...
Nothing to be done.
======
However, the MinGW64/bin directory has been added to the "%path%" (twice!), once by the installer and once by me.
In an attempt to resolve this issue, I have change the toolchain in the "Settings->Compiler/Debugger->Toolchain Executables"  from the default "gcc" to "x86_64-w64-mingw32-gcc.exe". I did the same with the g++'s entries. But this did not change anything.

What am I doing wrong?
Can anybody help?

TIA

Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: TDragon on September 03, 2010, 05:06:54 pm
Quote
Probably the toolchain path within the compiler options is not setup correctly?!
Thank you for failing to read --
You've really made my day.
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: thomas on September 03, 2010, 05:16:58 pm
Thank you for including LTO as well, John :)

Unluckily, LTO seems to still have some considerable problems. I've tried recompiling Code::Blocks with -flto. The first observation is that building takes approximately 8-10 times as long (which isn't a real issue to me if it's orthogonal -- you can do cheap builds during development and run one super expensive build with -flto added before release, which is perfectly acceptable as a one-time thing for a better optimized final build).

The second, much more severe issue is that the linker chokes on classes that have inline virtual destructors, complaining about double definitions. It also seems to have issues with classes which are derived from a virtual base class that do not provide an instance of the virtual destructor. Adding an instance (in a source file) removes the problem.

I started implementing a workaround for the Code::Blocks sources, but unluckily there are classes within wxWidgets (e.g. wxMemoryDC) which have the very same properties, and sure enough the compiler chokes on them too, so a functional workaround would require patching and recompiling wxWidgets :(

Well, looking forward to the next release with hopefully improved LTO :)

By the way, is there a way to make windres a bit less stupid? It seems to have hardcoded gcc.exe in its guts and apparently cannot be convinced by any means to invoke anything different, which of course means that it will consistently fail if the binary is named gcc-dw2.exe, both when building wxWidgets and anything that uses resources otherwise. The obvious workaround is to make a copy of the binary, but although this works, it is really less than optimal considering that it's only this one stupid tool which is not working right.
All other programs in the toolchain "know" the correct names of their siblings and can also be told to use arbitrary different names by setting CC, CPP, and CXX... only windres, is so f...ing stupid and stubborn.
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: thomas on September 03, 2010, 05:21:19 pm
Thank you for failing to read --
  • the TDM-GCC README,
  • Code::Blocks documentation,
  • Code::Blocks' own compiler settings dialog, and
  • the error message right before your eyes!
You've really made my day.
Oh oh... I've not read those either...  *whistles* :)
Let's hope my above post isn't documented in these.
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: TDragon on September 03, 2010, 07:49:09 pm
The second, much more severe issue is that the linker chokes on classes that have inline virtual destructors, complaining about double definitions. It also seems to have issues with classes which are derived from a virtual base class that do not provide an instance of the virtual destructor. Adding an instance (in a source file) removes the problem.
I'll look into this if I get a chance.

Quote
By the way, is there a way to make windres a bit less stupid? It seems to have hardcoded gcc.exe in its guts and apparently cannot be convinced by any means to invoke anything different, which of course means that it will consistently fail if the binary is named gcc-dw2.exe, both when building wxWidgets and anything that uses resources otherwise.
If I'm right, windres only invokes gcc for preprocessing purposes, so you should be able to add --preprocessor="gcc-dw2 -E -xc -DRC_INVOKED" to the windres command line to fix this.
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: Phenom on September 04, 2010, 08:11:46 pm
Hi, I was using TDM-GCC under Windows XP without problems. But recently I switched to Windows 7 and when I try to run an application compliled with TDM-GCC 4.5.0 I get that "libgcc_s_dw2-1.dll" is missing. Is this dll supposed to be installed with the compiler?

NOTE: Programms that were compiled with gcc 3.4.5 run normally.

How can I solve this issue?
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: MortenMacFly on September 04, 2010, 08:51:15 pm
"libgcc_s_dw2-1.dll" is missing.
[...]
How can I solve this issue?
http://lmgtfy.com/?q=%22libgcc_s_dw2-1.dll%22+is+missing
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: Phenom on September 04, 2010, 09:12:46 pm
I already have downloaded the missing file. But, what I wanted is to make my app run without it so I can distribute it without dlls.
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: TDragon on September 04, 2010, 10:33:37 pm
TDM-GCC does *not* create programs that rely on the libgcc DLL by default, so you are either

Make sure that no other version of GCC is being used -- especially, do *not* have an installation in C:\mingw (or D:\mingw, etc.), as that location is searched by default in every GCC installation!
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: Phenom on September 05, 2010, 11:52:43 am
  • using a different version of GCC, not TDM-GCC.

You were right about that:
Code
gcc --version
gcc (GCC) 4.5.0
Copyright (C) 2010 Free Softwarre Foundation, Inc.
<License stuff>


I guess I messed things up during installation. Well, recompiling with the actual TDM-GCC will solve this, right?

Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: Phenom on September 05, 2010, 03:29:03 pm
I successfully installed TDM-GCC 4.5.1 but I get link errors:
Code
obj\ZTimerManager.o:ZTimerManager.cpp:(.text+0xcd): undefined reference to `_Unwind_Resume'
obj\ZTimerManager.o:ZTimerManager.cpp:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0

I found some solutions like linking with libstdc++, someone mentioned that "__gxx part indicates that this is a g++-specific implementation issue. The .eh_frame probably indicates that it is concerned with exception handling, code for which may be automatically inserted for C++ programs. If so, you could disable exceptions with a compiler flag or link in the proper symbols from a library that came with your compiler (perhaps libstdc++?) " but none of these work.

Is there a flag or option I shoud add?

Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: TDragon on September 05, 2010, 04:48:27 pm
Those link errors are from object files that were compiled with the other version of GCC. You need to recompile everything with the new version.
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: Phenom on September 05, 2010, 07:27:04 pm
Those link errors are from object files that were compiled with the other version of GCC. You need to recompile everything with the new version.

I keep getting errors after rebuilding the whole project(though Build->Rebuild).

Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: TDragon on September 05, 2010, 09:39:32 pm
Make sure that no other version of GCC is being used -- especially, do *not* have an installation in C:\mingw (or D:\mingw, etc.), as that location is searched by default in every GCC installation!
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: Phenom on September 06, 2010, 01:58:37 pm
Those link errors are from object files that were compiled with the other version of GCC. You need to recompile everything with the new version.

I forgot to rebuild the libraries my program uses...
:D

Thanks for your help.

Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: nenin on September 16, 2010, 07:22:10 pm
Problem I reported here http://forums.codeblocks.org/index.php/topic,11055.msg77947.html#msg77947 not exists in 4.5.1-tdm-1 build.
Big thanks for TDragon. Nice job! 
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: xunxun on September 17, 2010, 08:58:17 am
Can this edition compile wxWidgets dll now?
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: reckless on September 17, 2010, 10:55:55 am
should think so got fixed patchwise as early as 4.5.0 ;) leo and i use it not sure about john ?
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: TDragon on September 17, 2010, 02:13:16 pm
xunxun1982, if you could be bothered to read the release notice you're replying to, it's fairly clear.
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
Post by: xunxun on September 17, 2010, 05:08:31 pm
xunxun1982, if you could be bothered to read the release notice you're replying to, it's fairly clear.
Oh, I'm sorry. And How do you solve this problem?
I make one gcc4.5.1 static edition (http://code.google.com/p/pcxprj/downloads/list, 32bit, lto, static), and I use the patch to undo the change by nathan (http://forums.codeblocks.org/index.php/topic,12183.msg85066.html#msg85066), which solves the Enormous increase in object files size.
That can compile wxWidgets smoothly now.
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: TDragon on March 28, 2011, 04:51:07 am
Greetings!

TDM-GCC 4.5.2 is now available!
The latest release of TDM-GCC incorporates GCC 4.5.2 in 32-bit and 32/64-bit editions, and includes LTO support.

The TDM release of GCC 4.5.2 is now available for download. As always, I've tested it on wxWidgets (2.8.11) and Code::Blocks SVN (7071) to ensure good compatibility.



TDM-GCC is available in TWO editions:
Along with the classic MinGW 32-bit edition, a new TDM64 edition is also available. This edition is based on the MinGW-w64 runtime API and the x86_64-w64-mingw32 GCC target, and can create both 32-bit and 64-bit code, with the "-m32"/"-m64" compiler flags. Please be aware, if you build Code::Blocks yourself, that it only works as 32-bit code ("-m32") on Windows, currently -- though that will hopefully change soon. Also, please never mix 32-bit object files (.o), libraries (.a), DLLs, or EXEs with 64-bit versions, and don't report it as a bug if you inadvertently do.

More information and downloads are available at <http://tdm-gcc.tdragon.net/ (http://tdm-gcc.tdragon.net/)>. TDM-GCC includes support for C, C++, Fortran, Objective-C/C++, and Ada (MinGW edition only), as well as support for the OpenMP multithreading extensions, packaged in a simple Windows installer.


Disclaimer:
As always, please remember:

Cheers,
John E. / TDM
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: ollydbg on March 28, 2011, 06:44:19 am
@John E. / TDM
thank you very much for your great work!!! I will try it :D.
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: killerbot on March 28, 2011, 07:43:54 am
this is great, as always.

The fact that 64 bit build currently is not possible of wx/CB, is that something you can influence, or is this a mingw or wxwidgets issue ?
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: MortenMacFly on March 28, 2011, 09:23:18 am
Thank you John, excellent work, as usual. 8)
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: ptDev on March 28, 2011, 10:12:49 am
Excellent! Thank you for your hard work, you're a life saver!
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: ptDev on March 28, 2011, 10:16:33 am
this is great, as always.

The fact that 64 bit build currently is not possible of wx/CB, is that something you can influence, or is this a mingw or wxwidgets issue ?

I believe that this is a wxWidgets issue. There are some people working on it, but nobody there promised any 64-bit support prior to 3.0.
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: byuu on March 28, 2011, 10:47:54 am
Hi, thank you very much for the 4.5.2 release, as well as for your previous releases.

I hate to nag, but have you had any luck with the std::thread support in this new release? Or is there an alternative to utilize this functionality with your builds?
I have a few applications that desperately need threading support, but I am averse to writing non-portable code to do it.

Thanks again for putting this package together for everyone!
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: oBFusCATed on March 28, 2011, 11:13:27 am
You can use boost.threads + something like:

Code
namespace mine 
{
#ifdef HAS_CPP_THREADS
using std::thread;
#else
using boost::thread;
#endif
}

Then in you code you use mine::thread and you have some flexibility.  :lol:
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: MortenMacFly on March 28, 2011, 12:11:19 pm
One annoyance I found...

If you install the packages selectively (skipping ADA and Object C) then when you try to compile something you get the error (freely translated from German):
---------------------------
as.exe - Component not found
---------------------------
Application could not be started as libintl-8.dll could not be found. A re-installation of the application may resolve this issue.
---------------------------
OK   
---------------------------

Which is the right pre-requisite you would recommend to install (unpack)? From MinGW.org?
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: ptDev on March 28, 2011, 01:52:32 pm
One annoyance I found...

If you install the packages selectively (skipping ADA and Object C) then when you try to compile something you get the error (freely translated from German):
---------------------------
as.exe - Component not found
---------------------------
Application could not be started as libintl-8.dll could not be found. A re-installation of the application may resolve this issue.
---------------------------
OK   
---------------------------

Which is the right pre-requisite you would recommend to install (unpack)? From MinGW.org?

This happened to me before as well. I could fix it with this package (http://sourceforge.net/projects/mingw/files/MinGW/gettext/gettext-0.17-1/libintl-0.17-1-mingw32-dll-8.tar.lzma/download) from mingw.org.
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: TDragon on March 28, 2011, 02:48:03 pm
Ugh... apparently since MinGW's binutils is now being compiled with NLS (native language support), it's introduced a libintl dependency on non-EN-US systems that I can't reproduce.

You want libintl-0.17-1-mingw32-dll-8.tar.lzma (http://sourceforge.net/projects/mingw/files/MinGW/gettext/gettext-0.17-1/libintl-0.17-1-mingw32-dll-8.tar.lzma/download), from the gettext package. You'll get it automatically in the installer if you choose the mingw32-make package; I'll make it a prereq on the binutils package as well, shortly. Please also let me know if there is a dependency on the libiconv DLL (libiconv-1.13.1-1-mingw32-dll-2.tar.lzma (http://sourceforge.net/projects/mingw/files/MinGW/libiconv/libiconv-1.13.1-1/libiconv-1.13.1-1-mingw32-dll-2.tar.lzma/download)).

byuu:
I seem to recall seeing some noise on a mailing list about a patch for GCC's gthreads code to let this work. Unfortunately that didn't make it into this release. My only alternative would be to support it with pthreads, but that would mean either forcing pthreads-w32 and the GPL license on every C++ user (definitely not going to happen), or creating yet another alternate distribution (probably not going to happen).
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: MortenMacFly on March 28, 2011, 03:22:59 pm
libintl-0.17-1-mingw32-dll-8.tar.lzma (http://sourceforge.net/projects/mingw/files/MinGW/gettext/gettext-0.17-1/libintl-0.17-1-mingw32-dll-8.tar.lzma/download)
That did it. I was guessing that's the one needed, now I am sure. Thanks! :D

libiconv-1.13.1-1-mingw32-dll-2.tar.lzma (http://sourceforge.net/projects/mingw/files/MinGW/libiconv/libiconv-1.13.1-1/libiconv-1.13.1-1-mingw32-dll-2.tar.lzma/download)
Nope, that seems not to be needed, compiling large project seems to work now.

BTW: These packages:
...and probably even those:
...are usually wise to install in addition to avoid common compilation errors with third party libraries (missing dependencies etc...). As you have links/dependencies on none-self-built libraries anyway, I could imagine adding these as an info/option for convenience on the webpage would help some people.
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: Xaviou on April 04, 2011, 03:15:08 pm
Hi
TDM-GCC 4.5.2 is now available!
Thank you very much for this, TDragon.


Can you confirm that 32-bits libs build with the 32/64-bits edition are compatibles with the 32-bits only edition ?

As always, I've tested it on wxWidgets (2.8.11)
I've tried with the 2.8.12, and encountered problems :
The compilation fails if UNICODE=0 (tried Debug/Release, Static/Shared, Multi-lib/Monolithic).
All the 8 configurations with UNICODE=0 give the same error :
Quote from: compiler
../../src/common/filefn.cpp: In function 'bool wxMkdir(const wxString&, int)':
../../src/common/filefn.cpp:1253:30: error: '_mkdir' was not declared in this scope
../../src/common/filefn.cpp: In function 'bool wxRmdir(const wxString&, int)':
../../src/common/filefn.cpp:1278:37: error: '_rmdir' was not declared in this scope
../../src/common/filefn.cpp:1280:1: warning: control reaches end of non-void function
mingw32-make.exe: *** [gcc_mswddll\monodll_filefn.o] Error 1

If UNICODE=1, all works fine.

Is there something I missed, or is this confirmed ?

Thank-you in advance.

Regards

Xav'
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: TDragon on April 07, 2011, 03:38:02 am
Can you confirm that 32-bits libs build with the 32/64-bits edition are compatibles with the 32-bits only edition ?
Yes. But you're responsible for knowing the ABI of any languages and libraries you try to use in this manner, so please don't post any questions or bug reports when you run into problems when doing this.

Quote
I've tried with the 2.8.12, and encountered problems :
...
If UNICODE=1, all works fine.

Is there something I missed, or is this confirmed ?
I haven't tried with 2.8.12.
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: Xaviou on April 07, 2011, 08:48:11 am
Hi

Can you confirm that 32-bits libs build with the 32/64-bits edition are compatibles with the 32-bits only edition ?
Yes. But you're responsible for knowing the ABI of any languages and libraries you try to use in this manner, so please don't post any questions or bug reports when you run into problems when doing this.
Of course. Thanks for the response.

Quote
I've tried with the 2.8.12, and encountered problems :
...
If UNICODE=1, all works fine.

Is there something I missed, or is this confirmed ?
I haven't tried with 2.8.12.
Resolved the problem with UNICODE=0 by adding a #include <direct.h> line in src/common/filefn.cpp  and src/common/debugrpt.cpp (thank you reckless (http://forums.codeblocks.org/index.php?action=profile;u=13553) for helping me by PM).
So I now can confirm that wxWidgets-2.8.12 can succesfully be build with TDM-GCC 4.5.2 with all classics configurations (I've tried all the 16 differents combinations) :

Thanks again to all

Regards

Xav'
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: stahta01 on July 15, 2011, 03:15:29 am
I was compiling code from http://cboard.cprogramming.com/cplusplus-programming/139494-getconsolescreenbufferinfoex-function.html#post1039300 (http://cboard.cprogramming.com/cplusplus-programming/139494-getconsolescreenbufferinfoex-function.html#post1039300)

And, I found,what I think are, a few typos in w64 headers.

Two in file wincrypt.h.
The structure define of CertSelectCertificateChains
Had "cCriteria DWORD," instead of "DWORD cCriteria,"

The structure define of CryptExportPublicKeyInfoFromBCryptKeyHandle
Had "void pvAuxInfo," instead of what I think was meant of "void* pvAuxInfo,"

One in file objbase.h
The prototype of CoGetApartmentType
Had something else instead of "HRESULT WINAPI CoGetApartmentType("

NOTE: I am just a C Programmer; So, you need to verify these are typos.

Tim S.
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: xunxun on July 15, 2011, 03:43:01 am
I was compiling code from http://cboard.cprogramming.com/cplusplus-programming/139494-getconsolescreenbufferinfoex-function.html#post1039300 (http://cboard.cprogramming.com/cplusplus-programming/139494-getconsolescreenbufferinfoex-function.html#post1039300)

And, I found,what I think are, a few typos in w64 headers.

Two in file wincrypt.h.
The structure define of CertSelectCertificateChains
Had "cCriteria DWORD," instead of "DWORD cCriteria,"

The structure define of CryptExportPublicKeyInfoFromBCryptKeyHandle
Had "void pvAuxInfo," instead of what I think was meant of "void* pvAuxInfo,"

One in file objbase.h
The prototype of CoGetApartmentType
Had something else instead of "HRESULT WINAPI CoGetApartmentType("

NOTE: I am just a C Programmer; So, you need to verify these are typos.

Tim S.

You can use latest MinGW64 svn.
These have been fixed.
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: TDragon on July 16, 2011, 05:05:07 am
Perhaps I'll create a new mingw64-runtime package in the near future.
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: Loaden on July 16, 2011, 06:26:13 am
Perhaps I'll create a new mingw64-runtime package in the near future.
Hope to upgrade the latest of GCC!
 :)
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: reckless on July 17, 2011, 01:09:50 am
im sure he will :)

in the meantime if you want to try the new gcc i made some builds public on my google code site.

http://mingw-wine.googlecode.com/files/mingw32-gcc-4.6.1-release.7z 32 bit mingw gcc
http://mingw-wine.googlecode.com/files/mingw64-gcc-4.6.1-release.7z 64 bit mingw gcc

both use the mingw 64 runtime so if you plan on upgrading from these you need that as well as binutils built for this arch.
ill make a complete pack soon. still hunting down some strange bug with xunxun in regards to the lto plugin.
Title: Re: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)
Post by: Justin Brimm on July 24, 2011, 06:45:23 am
I can barely wait until he releases a GCC 4.6.x build; the newest release of GCC has an entirely rewritten Objective-C runtime library that brings it up to Apple's specs, including Obj-C 2.0 support, garbage collection and synchronization. After having used TDM-GCC for so long though, other builds seem lackluster by comparison. I have to admit that I've been spoiled by the full 64 and 32 bit compilation support, as well as the inclusion of (so far) fully functional OpenMP 3.0 and pthreads.