Author Topic: TDM-GCC 4.5 series (Latest: 4.5.2 - 2011-03-27)  (Read 75295 times)

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: TDM-GCC 4.5.0 32- and 64-bit editions released
« Reply #60 on: July 08, 2010, 02:51:06 pm »
I may attempt to enable it in a future build.
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline a14331990

  • Multiple posting newcomer
  • *
  • Posts: 34
Re: TDM-GCC 4.5.0 32- and 64-bit editions released
« Reply #61 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.

Offline ironhead

  • Almost regular
  • **
  • Posts: 210
Re: TDM-GCC 4.5.0 32- and 64-bit editions released
« Reply #62 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.

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: TDM-GCC 4.5.0 32- and 64-bit editions released
« Reply #63 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.
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline ironhead

  • Almost regular
  • **
  • Posts: 210
Re: TDM-GCC 4.5.0 32- and 64-bit editions released
« Reply #64 on: August 12, 2010, 05:46:48 pm »
Change "-lstdc++.dll" to "-shared-libstdc++".

Much better thank you!

Offline ironhead

  • Almost regular
  • **
  • Posts: 210
Re: TDM-GCC 4.5.0 32- and 64-bit editions released
« Reply #65 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: [Select]
../../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: [Select]
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1

Online stahta01

  • Lives here!
  • ****
  • Posts: 6666
    • My Best Post
Re: TDM-GCC 4.5.0 32- and 64-bit editions released
« Reply #66 on: August 12, 2010, 08:23:05 pm »
@ironhead:

wxWidgets 2.8 is NOT 64 bit compatible under Windows.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ironhead

  • Almost regular
  • **
  • Posts: 210
Re: TDM-GCC 4.5.0 32- and 64-bit editions released
« Reply #67 on: August 12, 2010, 08:57:40 pm »
wxWidgets 2.8 is NOT 64 bit compatible under Windows.

That would explain it.

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
« Reply #68 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.

  • With the 4.5.1 release, GCC now includes support for LTO on MinGW and MinGW-w64 targets, so it's enabled in TDM-GCC.
  • As with the 4.5.0 release, I've maintained the *reversal* of 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.


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/>. 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:
  • TDM-GCC is not formally affiliated with or endorsed by the MinGW project.
  • 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
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline ptDev

  • Almost regular
  • **
  • Posts: 222
Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
« Reply #69 on: September 02, 2010, 09:41:08 am »
Unfortunately, the bugs related to the optimizer (my templates code crashes on runtime) are still present :(

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
« Reply #70 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... ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
« Reply #71 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>.
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline ArbolOne

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
« Reply #72 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


Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
« Reply #73 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 --
  • 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.
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: TDM-GCC 4.5 series (Latest: 4.5.1 & LTO support)
« Reply #74 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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."