Author Topic: FYI: GCC 4.5.0 on Mingw.org  (Read 86086 times)

Offline reckless

  • Regular
  • ***
  • Posts: 338
Re: FYI: GCC 4.5.0 on Mingw.org
« Reply #45 on: May 16, 2010, 07:28:45 pm »
cooking up a patch since the problem only seems to affect c++ so check for c++ and if found use old way if not use nathans.

seems like the way to do it correctly ?

Offline a14331990

  • Multiple posting newcomer
  • *
  • Posts: 34
Re: FYI: GCC 4.5.0 on Mingw.org
« Reply #46 on: May 17, 2010, 02:07:21 am »
cooking up a patch since the problem only seems to affect c++ so check for c++ and if found use old way if not use nathans.

seems like the way to do it correctly ?
Hello, reckless. Please have a look at this post
[Mingw-users] gcc 4.5 change to generate code for dllexport'd inline functions in the DLL
http://lists-archives.org/mingw-users/16635-gcc-4-5-change-to-generate-code-for-dllexport-d-inline-functions-in-the-dll.html
it says
Quote
For C DLLs the solution seems simple enough: just don't dllexport inline
functions and no code for them will be generated. But this doesn't work for
C++ DLLs
I think nathan's code is for C++ dlls especially libstdc++6.dll, before nathan's code there is no OLD way for libstdc++6.dll.   
it says more
Quote
Cesar Strauss did suggest another approach in private email: don't use
dllexport at all but rely on MinGW auto-import mechanism.
This idea works very good! Thanks Cesar's idea and Dave Korn's patch for Cygwin.
The auto-import approach do have some drawbacks:
Quote
but it's hardly ideal: all classes and
functions defined in the DLL are then exported, even those that are not
supposed to be used outside of it. This unnecessarily bloats (already
big) export tables and just seems like a step backwards. Indeed, if a
consequence of an improvement to dllexport mechanism is that now it can't
be used at all, what was the point of this improvement in the first case?

Offline a14331990

  • Multiple posting newcomer
  • *
  • Posts: 34
Re: FYI: GCC 4.5.0 on Mingw.org
« Reply #47 on: May 17, 2010, 02:14:54 am »
Leo's build of gcc, binutils, wxmsw, and cb6233 here.  8)
At Mr.Loaden's googlecode project,(I don't have enough time to manage patch/build/troubleshoot issues, thanks Mr.Loaden.)
http://code.google.com/p/qp-gcc/
located at Wiki and Downloads columns:
http://code.google.com/p/qp-gcc/wiki/GCC45BuildbyLeo
http://code.google.com/p/qp-gcc/wiki/InstallNotesForGCC45BuildByLeo
http://code.google.com/p/qp-gcc/downloads/list
Please help test them.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: FYI: GCC 4.5.0 on Mingw.org
« Reply #48 on: May 17, 2010, 03:08:05 am »
Leo's build of gcc, binutils, wxmsw, and cb6233 here.  8)
At Mr.Loaden's googlecode project,(I don't have enough time to manage patch/build/troubleshoot issues, thanks Mr.Loaden.)
http://code.google.com/p/qp-gcc/
located at Wiki and Downloads columns:
http://code.google.com/p/qp-gcc/wiki/GCC45BuildbyLeo
http://code.google.com/p/qp-gcc/wiki/InstallNotesForGCC45BuildByLeo
http://code.google.com/p/qp-gcc/downloads/list
Please help test them.
Nice, I will test it!! You're so smart!!!
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: FYI: GCC 4.5.0 on Mingw.org
« Reply #49 on: May 17, 2010, 04:46:24 am »
okidoki :)

can test the changes soon rebuild should be done in about an hour.

Offline reckless

  • Regular
  • ***
  • Posts: 338
Re: FYI: GCC 4.5.0 on Mingw.org
« Reply #50 on: May 17, 2010, 06:32:52 am »
done and working wx builds fine now :D

also updated my compiler to use sysroots (saves me some trouble when i need to rebuild the mingw64 runtime) also keeps the crt clean of any mess a user installs  :lol:

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: FYI: GCC 4.5.0 on Mingw.org
« Reply #51 on: May 17, 2010, 10:32:16 pm »
GCC 4.5.0 related bug reported to wxWidgets has a work around that I did not need on Multi-Lib Build but I did not test the DLLs.

http://trac.wxwidgets.org/ticket/12064

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

Offline a14331990

  • Multiple posting newcomer
  • *
  • Posts: 34
Re: FYI: GCC 4.5.0 on Mingw.org
« Reply #52 on: May 18, 2010, 04:52:26 am »
GCC 4.5.0 related bug reported to wxWidgets has a work around that I did not need on Multi-Lib Build but I did not test the DLLs.

http://trac.wxwidgets.org/ticket/12064

Tim S.
I have enabled --enable-auto-import in ld by default.

Offline a14331990

  • Multiple posting newcomer
  • *
  • Posts: 34
Re: FYI: GCC 4.5.0 on Mingw.org
« Reply #53 on: May 19, 2010, 02:19:24 am »
News for my build of MinGW GCC 4.5.0, I recently tested Dave Korn's LTO patch for MinGW/Cygwin [1], and it works.
    Enable instructions and prebuilt binary at qp-gcc googlecode page. Have a look at here for details.
http://code.google.com/p/qp-gcc/wiki/GCC45BuildByLeoWithLTO

[1] GCC Bugzilla Bug 42776 LTO doesn't work on non-ELF platforms.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42776

Offline reckless

  • Regular
  • ***
  • Posts: 338
Re: FYI: GCC 4.5.0 on Mingw.org
« Reply #54 on: May 19, 2010, 06:13:51 am »
had my looks on that one also :)  and it does indeed work.

the autotools for the mingw package works btw msys ones have been broken for ages i use these instead for most of the grunt work.

Offline reckless

  • Regular
  • ***
  • Posts: 338
Re: FYI: GCC 4.5.0 on Mingw.org
« Reply #55 on: May 19, 2010, 07:32:39 am »
packing up patched source of gcc-4.5.0 for those who wants to try compiling it themself :)

skip java if you like by removing --enable-libgcj from the pkgbuild script (does not work to well anyway).

the mingw64 guys might have a ball on this one since its based on there runtime but i managed to build the entire package with it so there should be some gold to dig out from it  :D atleast they should now have something to bootstrap there ada compiler :)


Offline a14331990

  • Multiple posting newcomer
  • *
  • Posts: 34
Re: FYI: GCC 4.5.0 on Mingw.org
« Reply #56 on: May 19, 2010, 09:35:36 am »
OK. Thanks for your suggestion. Packed the patched and autoconf'd source of gcc 4.5.0 at qp-gcc downloads column.
http://code.google.com/p/qp-gcc/downloads/list

Offline reckless

  • Regular
  • ***
  • Posts: 338
Re: FYI: GCC 4.5.0 on Mingw.org
« Reply #57 on: May 19, 2010, 12:15:49 pm »
packaging my version as i write.

btw for those who want to try lto dont use it while bootstrapping a gcc build ;) ada goes bonkers if you do. its C/C++ only.


Offline reckless

  • Regular
  • ***
  • Posts: 338
Re: FYI: GCC 4.5.0 on Mingw.org
« Reply #58 on: May 19, 2010, 12:26:48 pm »

Offline tyeken8

  • Single posting newcomer
  • *
  • Posts: 5
Re: FYI: GCC 4.5.0 on Mingw.org
« Reply #59 on: May 24, 2010, 03:45:23 am »
What version ld.exe are you using?
The one I am using is currently using 1.5GB of memory.
I assume it runs out at 2GB. This is linking wxWidgets 2.8 Branch.

It seems to have leveled off at 1.5GB. I am waiting till it finishes/crashes/errors out before getting the version number.

It ran out of memory.

Code
GNU ld (GNU Binutils) 2.20

Tim S.

That's solved!!!
I used a "hacked" ld.exe using the M$ Visual Studio tool "Editbin" to enable the Large Address Awareness feature, so that it can use up to 4GB Virtual memory (possibly need --large-address-aware option in ld).

Code
editbin /LARGEADDRESSAWARE c:\gcc\bin\ld.exe

with ld flags(passed to G++):
Code
-Wl,--enable-auto-import,--enable-runtime-pseudo-reloc-v2,--no-keep-memory,--reduce-memory-overheads,--large-address-aware

see this, http://www.microsoft.com/whdc/system/platform/server/PAE/PAEmem.mspx