Author Topic: GCC 4.4.0-tdm-1 for MinGW (with installer)  (Read 84936 times)

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
GCC 4.4.0-tdm-1 for MinGW (with installer)
« on: May 01, 2009, 09:19:10 pm »
The first TDM-GCC release in the 4.4 series is now available!

Yes, it did take a bit longer than usual from GCC vanilla release to TDM release, but hopefully you'll find it's worth it. Beyond a whole slew of minor improvements to standards-compliance and error checking, there are some nifty new optimizations -- particularly the Graphite loop optimizations. See http://gcc.gnu.org/gcc-4.4/changes.html for an overview of changes in the 4.4 series.

As usual, I tested this release by successfully building wxWidgets (2.8.10) and Code::Blocks (SVN r5554). Some helpful coding style diagnostics were produced, but no untoward errors in either!

Binary packages are available for the Ada, C, C++, Fortran, Objective-C, and Objective-C++ languages, as drop-in replacements for the MinGW project's official gcc packages. Full details and download links are at http://www.tdragon.net/recentgcc/ .

Disclaimer:
The TDM-GCC builds are unofficial replacements for the official MinGW releases of GCC binaries. TDM-GCC was previously recommended for experimentation purposes only, but constant use in day-to-day development and a total download count of over 60,000 have proven the TDM-GCC releases to be at least as usable as the most recent official MinGW GCC release. (Please note that this does not mean that there are no bugs; merely that there is a different set of bugs with a similar or lesser average criticality.) Therefore, TDM-GCC is now heartily endorsed for production use in any non-critical environment, with only the following caveats:
  • TDM-GCC is not formally affiliated with or endorsed by the MinGW project (although several MinGW team members make use of it)
  • No level of support for TDM-GCC is in any way guaranteed (although a best effort is made to fix bugs as they are found or forward them to GCC Bugzilla)

Cheers,
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 Lifof

  • Single posting newcomer
  • *
  • Posts: 2
Re: GCC 4.4.0-tdm-1 for MinGW (with installer)
« Reply #1 on: May 01, 2009, 10:25:50 pm »
Great ^^ I was waiting for this release since gcc.gnu.org announced the 4.4.0 of this marvelous cpp compiler.
Thanks for porting it to Windows and thanks to the Code::Blocks team for their wonderful IDE

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5489
Re: GCC 4.4.0-tdm-1 for MinGW (with installer)
« Reply #2 on: May 02, 2009, 10:04:55 am »
Thanks !!!


But I could not build CB : (wxwidgets was ok):

Code
-------------- Build: src in Code::Blocks ---------------

mingw32-g++.exe -Ldevel -Lsrc\wxAUI -Lbase\tinyxml -LC:\wxMSW-2.8.10\lib\gcc_dll -LC:\MinGW\lib  -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\ipc.o .objs\src\main.o .objs\src\printdlg.o .objs\src\scriptconsole.o .objs\src\scriptingsettingsdlg.o .objs\src\splashscreen.o .objs\src\startherepage.o  .objs\src\resources\resources.res  -Wl,--enable-auto-import  -lcodeblocks -lwxaui -lwxscintilla -lshfolder -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lcomctl32 -lodbc32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lwxmsw28u  -mwindows
c:/mingw/bin/../lib/gcc/mingw32/4.4.0/libgcc_eh.a(unwind-sjlj.o): In function `Unwind_SjLj_Unregister':
d:\crossdev\b4.4.0-tdm-1\mingw32\libgcc/../../../gcc-4.4.0/libgcc/../gcc/unwind-sjlj.c:189: multiple definition of `_Unwind_SjLj_Unregister'
devel/libcodeblocks.a(d000028.o):(.text+0x0): first defined here
c:/mingw/bin/../lib/gcc/mingw32/4.4.0/libgcc_eh.a(unwind-sjlj.o): In function `Unwind_SjLj_Register':
d:\crossdev\b4.4.0-tdm-1\mingw32\libgcc/../../../gcc-4.4.0/libgcc/../gcc/unwind-sjlj.c:142: multiple definition of `_Unwind_SjLj_Register'
devel/libcodeblocks.a(d000025.o):(.text+0x0): first defined here
c:/mingw/bin/../lib/gcc/mingw32/4.4.0/libgcc_eh.a(unwind-sjlj.o): In function `Unwind_SjLj_Resume':
d:\crossdev\b4.4.0-tdm-1\mingw32\libgcc/../../../gcc-4.4.0/libgcc/../gcc/unwind.inc:220: multiple definition of `_Unwind_SjLj_Resume'
devel/libcodeblocks.a(d000026.o):(.text+0x0): first defined here
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 9 seconds)
3 errors, 0 warnings
 

Offline Lifof

  • Single posting newcomer
  • *
  • Posts: 2
Re: GCC 4.4.0-tdm-1 for MinGW (with installer)
« Reply #3 on: May 02, 2009, 10:56:20 am »
Code
-------------- Build: src in Code::Blocks ---------------

mingw32-g++.exe -Ldevel -Lsrc\wxAUI -Lbase\tinyxml -LC:\wxMSW-2.8.10\lib\gcc_dll -LC:\MinGW\lib  -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\ipc.o .objs\src\main.o .objs\src\printdlg.o .objs\src\scriptconsole.o .objs\src\scriptingsettingsdlg.o .objs\src\splashscreen.o .objs\src\startherepage.o  .objs\src\resources\resources.res  -Wl,--enable-auto-import  -lcodeblocks -lwxaui -lwxscintilla -lshfolder -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lcomctl32 -lodbc32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lwxmsw28u  -mwindows
c:/mingw/bin/../lib/gcc/mingw32/4.4.0/libgcc_eh.a(unwind-sjlj.o): In function `Unwind_SjLj_Unregister':
d:\crossdev\b4.4.0-tdm-1\mingw32\libgcc/../../../gcc-4.4.0/libgcc/../gcc/unwind-sjlj.c:189: multiple definition of `_Unwind_SjLj_Unregister'
devel/libcodeblocks.a(d000028.o):(.text+0x0): first defined here
c:/mingw/bin/../lib/gcc/mingw32/4.4.0/libgcc_eh.a(unwind-sjlj.o): In function `Unwind_SjLj_Register':
d:\crossdev\b4.4.0-tdm-1\mingw32\libgcc/../../../gcc-4.4.0/libgcc/../gcc/unwind-sjlj.c:142: multiple definition of `_Unwind_SjLj_Register'
devel/libcodeblocks.a(d000025.o):(.text+0x0): first defined here
c:/mingw/bin/../lib/gcc/mingw32/4.4.0/libgcc_eh.a(unwind-sjlj.o): In function `Unwind_SjLj_Resume':
d:\crossdev\b4.4.0-tdm-1\mingw32\libgcc/../../../gcc-4.4.0/libgcc/../gcc/unwind.inc:220: multiple definition of `_Unwind_SjLj_Resume'
devel/libcodeblocks.a(d000026.o):(.text+0x0): first defined here
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 9 seconds)
3 errors, 0 warnings

I think that's because you have installed gcc in 2 directories c:\mingw and d:\crossdev\b4.4.0-tdm-1 and pardon me if i'm wrong.

Offline gd_on

  • Lives here!
  • ****
  • Posts: 795
Re: GCC 4.4.0-tdm-1 for MinGW (with installer)
« Reply #4 on: May 02, 2009, 04:30:49 pm »
Hi,
same problem and same messages here.
d:\crossdev\b4.4.0-tdm-1\mingw32\libgcc is not on my PC, but may be on TDM's one ! Probably this path comes from somewhere in a distributed file...

Previously, I had TDM 4.3.3. To install this new one 4.4, I made first a copy of 4.3.3, then only replaced in folders by the content of core, g++ and fortran.

gd_on
Windows 11 64 bits (23H2), svn C::B (last version or almost!), wxWidgets 3.2.4 (tests with 3.3), Msys2 Compilers 13.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5906
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: GCC 4.4.0-tdm-1 for MinGW (with installer)
« Reply #5 on: May 02, 2009, 05:04:58 pm »
I have the same problem like killerbot.

By the way, I haven't rebuilt the wxWidgets library with gcc 4.4.(I use the old library built with tdm-gcc 3.3, is it the problem?)

Code
[ 94.7%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE  -DBUILDING_PLUGIN    -Iinclude -Iinclude\wxFlatNotebook\include -Iinclude\scripting\include -Iinclude\scripting\sqplus -ID:\wxWidgets-2.8.10\include -ID:\wxWidgets-2.8.10\lib\gcc_dll\mswu -Iinclude\wxscintilla\include -Iinclude\tinyxml  -c F:\cb_svn\src\src\startherepage.cpp -o .objs\src\startherepage.o
[100.0%] g++.exe -Ldevel -Lsrc\wxAUI -Lbase\tinyxml -LD:\wxWidgets-2.8.10\lib\gcc_dll  -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\ipc.o .objs\src\main.o .objs\src\printdlg.o .objs\src\scriptconsole.o .objs\src\scriptingsettingsdlg.o .objs\src\splashscreen.o .objs\src\startherepage.o  .objs\src\resources\resources.res  -Wl,--enable-auto-import  -lcodeblocks -lwxaui -lwxscintilla -lshfolder -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lcomctl32 -lodbc32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lwxmsw28u  -mwindows
d:/mingw/bin/../lib/gcc/mingw32/4.4.0/libgcc_eh.a(unwind-sjlj.o): In function `Unwind_SjLj_Unregister':
d:\crossdev\b4.4.0-tdm-1\mingw32\libgcc/../../../gcc-4.4.0/libgcc/../gcc/unwind-sjlj.c:189: multiple definition of `_Unwind_SjLj_Unregister'
devel/libcodeblocks.dll.a(d000028.o):(.text+0x0): first defined here
d:/mingw/bin/../lib/gcc/mingw32/4.4.0/libgcc_eh.a(unwind-sjlj.o): In function `Unwind_SjLj_Register':
d:\crossdev\b4.4.0-tdm-1\mingw32\libgcc/../../../gcc-4.4.0/libgcc/../gcc/unwind-sjlj.c:142: multiple definition of `_Unwind_SjLj_Register'
devel/libcodeblocks.dll.a(d000025.o):(.text+0x0): first defined here
d:/mingw/bin/../lib/gcc/mingw32/4.4.0/libgcc_eh.a(unwind-sjlj.o): In function `Unwind_SjLj_Resume':
d:\crossdev\b4.4.0-tdm-1\mingw32\libgcc/../../../gcc-4.4.0/libgcc/../gcc/unwind.inc:220: multiple definition of `_Unwind_SjLj_Resume'
devel/libcodeblocks.dll.a(d000026.o):(.text+0x0): first defined here
collect2: ld returned 1 exit status
Process terminated with status 1 (3 minutes, 26 seconds)
3 errors, 27 warnings

My original TDM-MinGW was in D:\mingw.
I just update this folder with the new 4.4.0 version.

It seems there is no such folder named "d:\crossdev\b4.4.0-tdm-1". in my system. :D

« Last Edit: May 02, 2009, 05:10:23 pm by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: GCC 4.4.0-tdm-1 for MinGW (with installer)
« Reply #6 on: May 02, 2009, 06:20:18 pm »
Apparently the one change I made between the version I used to build Code::Blocks and the release version affected more than I thought!

Until this is fixed, adding "-Wl,--exclude-libs,libgcc_eh.a" to the Other linker options for the "sdk" target will allow the build to succeed.
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 TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: GCC 4.4.0-tdm-1 for MinGW (with installer)
« Reply #7 on: May 03, 2009, 01:24:39 am »
I've uploaded patched versions of the core, g++ and fortran packages, and this problem should be gone. As always, the TDM/MinGW installer should detect the upgrades automatically when you choose "Manage"; or, if downloading manually, be sure to get the new packages ending in "-2".

Also I uploaded a new version of the installer (1.905.0) that doesn't add the "bin" directory to the PATH environment variable if it's already there.
« Last Edit: May 03, 2009, 01:26:17 am by TDragon »
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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5906
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: GCC 4.4.0-tdm-1 for MinGW (with installer)
« Reply #8 on: May 03, 2009, 03:05:46 am »
Thanks for your effort!
I will download and test it now. :D

Edit:

build codeblocks successfully! Great!
« Last Edit: May 03, 2009, 04:03:31 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: GCC 4.4.0-tdm-1 for MinGW (with installer)
« Reply #9 on: May 03, 2009, 01:50:45 pm »
Thanks once again for the effort :)
Unluckily this build gives me internal compiler errors (segfault) which I'm unable to properly identify.

I've got a function declared __attribute__ (( __cold__ )) contained in a namespace, and it ICEs on a harmless for() loop. If I comment out the for() or remove either attribute or namespace, it compiles fine. If I copy and paste the function as-is into a "hello world" project, it works fine.
The 4.3 compiler has no problems with the same code.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: GCC 4.4.0-tdm-1 for MinGW (with installer)
« Reply #10 on: May 03, 2009, 02:09:08 pm »
Hmm actually it turns out my my target-specific macros contain
#if(GCC_VERSION >= 440)
  #define cold_func __attribute__ (( __cold__, optimize("Os") ))

and removing the optimize("Os") removes the ICE after a clean rebuild. So it's "optimize", not "cold".
Interestingly, it seems that anything other than "O1" gives an ICE... hmm...
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: GCC 4.4.0-tdm-1 for MinGW (with installer)
« Reply #11 on: May 03, 2009, 02:22:49 pm »
Ok, I've manually tried all options that the big-O options turn on one by one, and -fcaller-saves is the culprit.
If one writes __attribute__ (( __optimize__ ("Os,no-caller-saves") )) the ICE is gone.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: GCC 4.4.0-tdm-1 for MinGW (with installer)
« Reply #12 on: May 03, 2009, 04:56:00 pm »
Would you by any chance be able to post code for a testcase?
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 thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: GCC 4.4.0-tdm-1 for MinGW (with installer)
« Reply #13 on: May 03, 2009, 05:32:01 pm »
Well, like I said, if I make a new project with just a main() function and the offending attribute declaration and a bogus function definition, the ICE does not occur, so that'll be no help. Posting the entire project is not an option, unluckily.

However, as described above, I found out that -fcaller-saves (which O2, O3, Os enable) is the culprit. Explicitely disabling caller saves makes the ICE go away. This might possibly give someone interested in the problem a clue where to look.

Alternatively, is there a way to tell gcc not to install signal handlers? Since it reports a segfault, this should actually kick off the just-in-time debugger if gcc didn't catch the exception, so I should be able to get a core dump.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5906
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: GCC 4.4.0-tdm-1 for MinGW (with installer)
« Reply #14 on: May 03, 2009, 05:37:41 pm »
Excuse me, What does the ICE means?
Thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.