Author Topic: gcc-4.6.1 builds availiable  (Read 31225 times)

Offline reckless

  • Regular
  • ***
  • Posts: 338
gcc-4.6.1 builds availiable
« on: July 03, 2011, 09:56:11 am »
made some i686-w64-mingw32 and x86_64-w64-mingw32 builds of gcc-4.6.1 available on my google code site.

lots of bugfixing since 4.6.0 (one was a bug causing codeblocks to crash when calling cpp.exe)  typo in cppspec.c.

gcc now supports i7 processors.

wxwidgets can now be build without the dllinline patch by adding this to wxwidgets/build/msw/config.gcc

# Standard flags for CC
CFLAGS ?= -fno-keep-inline-dllexport

# Standard flags for C++
CXXFLAGS ?= -fno-keep-inline-dllexport

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

specific questions ? pm me or send me a mail. i cannot answer them here.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: gcc-4.6.1 builds availiable
« Reply #1 on: July 06, 2011, 05:02:19 am »
good, and there is another mingw 4.6.1 by xunxun
MinGW_gcc4.6.1release_static_win32.7z
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 reckless

  • Regular
  • ***
  • Posts: 338
Re: gcc-4.6.1 builds availiable
« Reply #2 on: August 05, 2011, 07:16:20 pm »
not hosted on my google code site because of it's size but here's a link to my development environment (warning its big).

ftp://90.184.233.166:21/cb-setup.exe or if you prefer you can use my downloader ftp://90.184.233.166:21/cb-adv-downloader.exe

the downloader is just a 7zip selfextracter with a download folder inside. just doubleclick the download.bat in the folder and it will get the installer and when done downloading start the setup.

the suite includes pretty much anything you could need for emediate development and a few tools i created myself to get around vista/win 7 problems like UAC and admin access.

the Msys shells are auto elevated to admin level so you dont have to rightclick and select run as admin anymore.

both Local/bin mingw32/bin and mingw64/bin are added to path so that part is not nessesary anymore either.

Local contains some tools shared between both mingw versions like cmake/ruby/python/svn and putty. these tools are also visible to codeblocks when Local is added to path.

CodeBlocks itself is latest svn version (built yesterday) and i included tools in the root folder codeblocks use, like cscope cccc and cppcheck. i modified the compilerplugin a bit to use the mingw64 32 bit compiler by default.

msys was also heavily modified by me to work a bit more like the cygwin shell and includes some stuff you probably cant get anywhere else like ncurses (shared build) and lynx for msys.
you can build msys packages also by selcting msysdvlpr posix shell from the msys shell. ncurses was also ported to mingw recently so now theres an alternative to pdcurses.

all questions related to the above should be mailed to me or send me a PM, i cannot answer them here.




Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: gcc-4.6.1 builds availiable
« Reply #3 on: August 05, 2011, 09:04:02 pm »
i modified the compilerplugin a bit to use the mingw64 32 bit compiler by default.
I appreciate your effort, but did you ensure to provide the sources, too to comply with the GPL license? I didn't find it. You wrote that you modified the core, thus a patch / sources is required. Especially if you distribute the link through our forum.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline reckless

  • Regular
  • ***
  • Posts: 338
Re: gcc-4.6.1 builds availiable
« Reply #4 on: August 05, 2011, 09:51:47 pm »
not packaged yet but its in my home folder so no problem :) ill make a patch but the changes are pretty small basically i just changed the name of the mingw folder to mingw32 for the 32 bit compiler and the prefix for the mingw executables from mingw32-gcc.exe etc. to i686-w64-mingw32-gcc.exe.

all changes are in the compilermingw.cpp plugin source.

if possible ill try to get it to autodetect both the 64 and 32 bit compiler atm only the 32 bit one is autodetected.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: gcc-4.6.1 builds availiable
« Reply #5 on: August 05, 2011, 10:02:40 pm »
if possible ill try to get it to autodetect both the 64 and 32 bit compiler atm only the 32 bit one is autodetected.
That would be a nice contribution. :-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline reckless

  • Regular
  • ***
  • Posts: 338
Re: gcc-4.6.1 builds availiable
« Reply #6 on: August 05, 2011, 10:12:00 pm »
ok ill see what i can cook up :) packaging the source now should be on the ftp in a few minutes. or if you prefer ill put it on my google code site the size should be ok for that.

then ill make a diff.

Offline reckless

  • Regular
  • ***
  • Posts: 338
Re: gcc-4.6.1 builds availiable
« Reply #7 on: August 05, 2011, 10:42:15 pm »
modified trunk source should be up now.

ftp://90.184.233.166:21/codeblocks-trunk-modified-src.7z

might have a solution to the detection of the 64 bit compiler allready but still running some tests. still pretty new to wxwidgets :)
« Last Edit: August 05, 2011, 10:46:09 pm by reckless »

Offline reckless

  • Regular
  • ***
  • Posts: 338
Re: gcc-4.6.1 builds availiable
« Reply #8 on: August 05, 2011, 11:06:14 pm »
ftp://90.184.233.166:21/compilerMINGW.diff

diff of the changes unfortunatly still needs some work, as it seems checking wxIsPlatform64Bit() only applies to wxwidget itself hm ? ideas are welcome.

Offline reckless

  • Regular
  • ***
  • Posts: 338
Re: gcc-4.6.1 builds availiable
« Reply #9 on: August 06, 2011, 08:27:01 am »
slight change to the diff the first one was a bit messy.

Code
--- compilerMINGW.cpp.orig	2011-08-05 20:58:41 +0000
+++ compilerMINGW.cpp 2011-08-06 06:23:08 +0000
@@ -25,7 +25,7 @@
 #include <configmanager.h>
 
 #ifdef __WXMSW__
-    #include <wx/msw/registry.h>
+#include <wx/msw/registry.h>
 #endif
 
 CompilerMINGW::CompilerMINGW(const wxString& name, const wxString& ID)
@@ -55,13 +55,27 @@
 {
     if (platform::windows)
     {
-        m_Programs.C         = _T("mingw32-gcc.exe");
-        m_Programs.CPP       = _T("mingw32-g++.exe");
-        m_Programs.LD        = _T("mingw32-g++.exe");
-        m_Programs.DBG       = _T("gdb.exe");
-        m_Programs.LIB       = _T("ar.exe");
-        m_Programs.WINDRES   = _T("windres.exe");
-        m_Programs.MAKE      = _T("mingw32-make.exe");
+        // need an idea to also reset the standard mingw compiler ?
+        if (wxIsPlatform64Bit())
+        {
+            m_Programs.C         = _T("x86_64-w64-mingw32-gcc.exe");
+            m_Programs.CPP       = _T("x86_64-w64-mingw32-g++.exe");
+            m_Programs.LD        = _T("x86_64-w64-mingw32-g++.exe");
+            m_Programs.DBG       = _T("gdb.exe");
+            m_Programs.LIB       = _T("ar.exe");
+            m_Programs.WINDRES   = _T("windres.exe");
+            m_Programs.MAKE      = _T("winmake.exe");
+        }
+        else
+        {
+            m_Programs.C         = _T("i686-w64-mingw32-gcc.exe");
+            m_Programs.CPP       = _T("i686-w64-mingw32-g++.exe");
+            m_Programs.LD        = _T("i686-w64-mingw32-g++.exe");
+            m_Programs.DBG       = _T("gdb.exe");
+            m_Programs.LIB       = _T("ar.exe");
+            m_Programs.WINDRES   = _T("windres.exe");
+            m_Programs.MAKE      = _T("winmake.exe");
+        }
     }
     else
     {
@@ -96,12 +110,12 @@
 
     m_Options.ClearOptions();
     m_Options.AddOption(_("Produce debugging symbols"),
-                _T("-g"),
-                _("Debugging"),
-                _T(""),
-                true,
-                _T("-O -O1 -O2 -O3 -Os"),
-                _("You have optimizations enabled. This is Not A Good Thing(tm) when producing debugging symbols..."));
+                        _T("-g"),
+                        _("Debugging"),
+                        _T(""),
+                        true,
+                        _T("-O -O1 -O2 -O3 -Os"),
+                        _("You have optimizations enabled. This is Not A Good Thing(tm) when producing debugging symbols..."));
     wxString gprof_link = _T("-pg");
     if (platform::windows)
         gprof_link = _T("-pg -lgmon");
@@ -144,6 +158,7 @@
     m_Options.AddOption(_("Optimize generated code (for size)"), _T("-Os"), category);
     m_Options.AddOption(_("Expensive optimizations"), _T("-fexpensive-optimizations"), category);
     m_Options.AddOption(_("Don't keep the frame pointer in a register for functions that don't need one"), _T("-fomit-frame-pointer"), category);
+
     // machine dependent options - cpu arch
     category = _("CPU architecture tuning (choose none, or only one of these)");
     m_Options.AddOption(_("i386"), _T("-march=i386"), category);
@@ -175,6 +190,7 @@
     m_Commands[(int)ctGenDependenciesCmd].push_back(CompilerTool(_T("$compiler -MM $options -MF $dep_object -MT $object $includes $file")));
     m_Commands[(int)ctCompileResourceCmd].push_back(CompilerTool(_T("$rescomp -i $file -J rc -o $resource_output -O coff $res_includes")));
     m_Commands[(int)ctLinkConsoleExeCmd].push_back(CompilerTool(_T("$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs")));
+
     if (platform::windows)
     {
         m_Commands[(int)ctLinkNativeCmd].push_back(CompilerTool(_T("$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs --subsystem,native")));
@@ -249,15 +265,25 @@
             }
         }
     }
-
     wxString sep = wxFileName::GetPathSeparator();
+
     if (platform::windows)
     {
         // look first if MinGW was installed with Code::Blocks (new in beta6)
         m_MasterPath = ConfigManager::GetExecutableFolder();
         if (!wxFileExists(m_MasterPath + sep + _T("bin") + sep + m_Programs.C))
+        {
             // if that didn't do it, look under C::B\MinGW, too (new in 08.02)
             m_MasterPath += sep + _T("MinGW");
+        }
+
+        if (!wxFileExists(m_MasterPath + sep + _T("bin") + sep + m_Programs.C))
+        {
+            // if that didn't do it, look under C::B\MinGW32 or C::B\MinGW64, too (new in 08.02)
+            m_MasterPath += wxIsPlatform64Bit() ? sep + _T("MinGW64") : sep + _T("MinGW32");
+        }
+
+        // standard mingw no 64 bit compiler and the mingw64 compiler has no ini.
         if (!wxFileExists(m_MasterPath + sep + _T("bin") + sep + m_Programs.C))
         {
             // no... search for MinGW installation dir
@@ -300,16 +326,15 @@
 #endif
             }
         }
-        else
-            m_Programs.MAKE = _T("make.exe"); // we distribute "make" not "mingw32-make"
+        else m_Programs.MAKE = _T("make.exe"); // we distribute "make" not "mingw32-make"
     }
-    else
-        m_MasterPath = _T("/usr");
+    else m_MasterPath = _T("/usr");
 
     AutoDetectResult ret = wxFileExists(m_MasterPath + sep + _T("bin") + sep + m_Programs.C) ? adrDetected : adrGuessed;
     // don't add lib/include dirs. GCC knows where its files are located
 
     SetVersionString();
+
     return ret;
 }
 
@@ -317,7 +342,7 @@
 {
     /*  NOTE (Biplab#9#): There is a critical bug which blocks C::B from starting up.
         So we'll disable version string checking till we fix the bug. */
-    #if !wxCHECK_VERSION(2, 9, 0)
+#if !wxCHECK_VERSION(2, 9, 0)
 //    Manager::Get()->GetLogManager()->DebugLog(_T("Compiler detection for compiler ID: '") + GetID() + _T("' (parent ID= '") + GetParentID() + _T("')"));
 
     wxArrayString output, errors;
@@ -394,5 +419,5 @@
             }
         }
     }
-    #endif
+#endif
 }

wxIsPlatform64Bit() should actually work but my C++ fu is a bit impaired so i likely made some mistake. im normally used to working in old C mode.

still need to find a solution to reset the standard MinGW compiler's executables with the new autodetect code. atm it will only work for the mingw64 compiler. it should be as easy as checking for a certain #define only present in mingw64 but i forgot its name so i need to find it again.
« Last Edit: August 06, 2011, 08:33:37 am by reckless »

Offline reckless

  • Regular
  • ***
  • Posts: 338
Re: gcc-4.6.1 builds availiable
« Reply #10 on: August 06, 2011, 10:28:26 am »
slight update.

codeblocks spellchecker was missing its dictionaries so i added all i could get my hands on.

link for codeblocks only ftp://90.184.233.166:21/codeblocks-only.7z can overwrite the one from the installer i only added the dictionaries so the spellchecker works.

edit: also added gcc-4.6.1's CPU optimization option to the compiler plugin aka -march=corei7. several other optimization options i will be adding as soon as i get the list complete ;)

ill keep the diff updated with changes so redownloading it will give you the one with the latest changes.

edit: changed latest diff name to compilerMINGW.diff2 (only includes the CPU optimization change) might not be good to apply it to trunk yet if the gcc you want to use is older than 4.6 though as i havent implemented checking  for gcc version yet. so you might end up with an issue with older mingw compilers that dont support this.

i could use a couple of define checks to check gcc version but im not sure if you're ok with that ?.
« Last Edit: August 06, 2011, 03:17:07 pm by reckless »

Offline reckless

  • Regular
  • ***
  • Posts: 338
Re: gcc-4.6.1 builds availiable
« Reply #11 on: August 06, 2011, 03:21:43 pm »
updated installer with recent changes.

mysql connect interface was using the wrong include and library paths (/usr/local/include and /usr/local/lib) fixed now to use (/mingw32/lib and /mingw32/include for the 32 bit mingw and /mingw64/lib and /mingw64/include for the 64 bit mingw) changes only realy apply to users who will use mysql from the Msys shells with mysql_config.exe.

merged changes for codeblocks-only into the installer.

Offline reckless

  • Regular
  • ***
  • Posts: 338
Re: gcc-4.6.1 builds availiable
« Reply #12 on: August 08, 2011, 03:26:47 am »
more updates.

msys now has a working lynx :) helpfull in some cases. uses s-lang and openssl.
tools in /usr/local updated (crapload of python extentions added like wxpython pyqt easyinstall kid cherrypy etc) several tools to go with these two like a special python shell in wx and a gui editor for pyqt.
added several source revision tools like git and mercurial and the console svn client now has a rapidsvn gui you can add to codeblocks tools.
also added qtgit which can be used like the svn gui from codeblocks tools menu (can be a bit hard setting qtgit up so i left the tcl gui in as a default) git is made for mingw not msys and was patched a bit because the tcl gui thinks im using cygwin /facedesk. it can use both msys perl's and the mingw python's interfaces.

modified /etc/profile a bit more. now msys will autocreate reparse points for the sysroot for both compilers.

still not satisfied with C::B's detection of the mingw64 compiler but its better than it was atleast. still working on it.

Offline reckless

  • Regular
  • ***
  • Posts: 338
Re: gcc-4.6.1 builds availiable
« Reply #13 on: August 08, 2011, 11:10:49 pm »
taking ftp offline for about a day moving my files to an old computer i setup as server cause my work computer is rather expensive to have running 24/7  :lol:
one of the downfalls of having a monster PC.

it should be up again tomorrow evening.

Offline reckless

  • Regular
  • ***
  • Posts: 338
Re: gcc-4.6.1 builds availiable
« Reply #14 on: August 09, 2011, 06:29:55 pm »
heh seems the old computer i wanted to use for a server hit the end of life in the hard way (boom) :S

so im back to hosting it on my work machine for the time being. i might opt for a sourceforge account if there limit allows files of this size. anyone know ?