GCC/GCJ for MinGW

Overview

This page is a temporary holding spot for my build of the mingw32 target of a CVS snapshot of certain  GCC/GCJ  branches. Here, you can download a Win32 (MingW) build of GCC, which can compile C, C++ and Java code into native Windows executables!

Before I type any further, I want to give due credit to people like Adam Megacz, Mumit Khan, and everyone behind GCJ, GCC and MingW. In addition to submitting numerous patches and observations in order to get the latest GCJ built and working on MingW, Ranjit Mathew went above and beyond the call of duty in guiding me through this effort. In the short time that I've been involved in this, I've learned an incredible amount thanks to Ranjit and other helpful souls involved with GCC and GCJ.

Please send feedback! Let me know if there is a better place to put this snapshot, if I have made factual errors or could have done things better, and any other comments you might have.

Quick Links

GCC/GCJ 3.4

The Bundle

Here is the bundle:

gcc34-20040607.tar.bz2 (45 819 475 bytes)
(MD5 checksum: 8aea89b55ffae6f6fd675cddc83bcefd)

It includes:

  • a build of GCC 3.4 from a CVS snapshot taken at about 16 March 2004 plus some as-yet-unapproved patches.
  • binutils-2.14.90-20030612-1, w32api-2.4 and mingw-runtime-3.2 from the MingW download page
  • a GCJ build of the Win32 swt.jar (libswt.a which uses swt-win32-3054.dll, shipped with Eclipse 3.0)
  • SwingWT 0.83
  • sample applications (console, SWT, Swing, AWT miscellaneous)

SwingWT is a Swing and partial AWT implementation which uses SWT under the covers. It allows gcj to compile AWT and Swing applications.

How do I unzip a .tar.bz2 archive?"
If your Windows archive utility doesn't support this, download MSYS from http://www.mingw.org/. From the MSYS prompt, type:

tar xvfj archive.tar.bz2

in the directory you want to decompress this to.

Integrated SWT and SwingWT

This build allows for integrated SWT and SwingWT (see the links above) as two of the four possible build configurations (see below). With integrated SWT and SwingWT, the appropriate classes have been integrated into the libgcj jar file and library so you don't need to add swt.jar to the classpath or link against libswt.a. The SWT build used is v3054; the SwingWT build used is v0.83.

To integrate SwingWT, I first surgically removed the GNU AWT and Swing sources from the libgcj build (see noawt.diff in the patch list below). I then modified the SwingWT sources, changing packages swingwt.* and swingwtx.* to java.* and javax.*. There are post-libgcj build steps which fold the SWT and SwingWT classes and objects into the libgcj libraries and jar.

Important Note: none of this is intended to minimize the importance of the ongoing GNU libgcj and CLASSPATH work to implement Swing and AWT. The GNU libgcj folks are doing an amazing job and are making amazing progress. I even attempted to start coding up the Win32 AWT peers - you can get my half-baked sources here - but have no idea if I'll ever finish. Someone else is welcome to carry this forward.

Here are some screenshots of Swing and AWT applications running on Win32:

EclipseLauncher (Swing)
http://www.thisiscool.com/gcj/EclipseLauncher.jpg

SaveThatCalendar (AWT)
http://www.thisiscool.com/gcj/SaveThatCalendar.jpg

Nim (AWT)
http://www.thisiscool.com/gcj/nim.jpg
(this hangs when you try to exit it)

Build Configurations

There are four build configurations:

  • statically linked using the original libraries
  • dynamically linked using the original libraries
  • statically linked using integrated SWT + SwingWT
  • dynamically linked using integrated SWT + SwingWT

To switch configurations, ensure that gcj is in your system path and type:

gcj-lib orig | origdll | gui | guidll

If you dynamically link executables and redistribute them, please remember that the GNU Public License requires you to make the source available for libgcj.dll in the same manner that you distribute your binaries. See COPYING in thisiscool-gcc/gcc-3.4 for full details.

Depending on whether you use, origdll or guidll, you'll need to rename either of libgcj.dll.origdll or libgcj.dll.guidll to libgcj.dll and put this somewhere in your system path. These are found in thisiscool-gcc/gcc-3.4/i686-pc-mingw32/lib. For GUI builds, you'll also need swt-win32-3054.dll in your system path. (Yes, I know that thisiscool-gcc/gcc-3.4/i686-pc-mingw32/lib is a lousy place to put these.)

GUI Samples

The samples are in the examples directory. 

They are all built by the top-level makefile. The GUI samples are:

Sample Description
EclipseLauncher A Swing program which demonstrates loading image resources from the executable.
GUILauncher A simple SWT program.
HelloSWT An SWT program which demonstrates loading image resources from the executable.
Nim An AWT program.
SaveThatCalendar An AWT program.

Uncommitted Patches

The build contains the following patches discussed in the java and java-patches mailing lists. Be aware that these have not yet been approved and some of them may never be accepted:

Short Description Location
Exceptions across boundaries http://sourceforge.net/mailarchive/forum.php?thread_id=3888273&forum_id=5123
BufferedReader optimizations http://gcc.gnu.org/ml/java-patches/2004-q1/msg00385.html
mcastGrp http://gcc.gnu.org/ml/java-patches/2004-q1/msg00668.html
GNU AWT/Swing Removal http://www.thisiscool.com/gcj/noawt.diff
Disable verifier hack http://www.filewatcher.com/p/gcc-ssa-3.5ssa-0.20030801.47.src.rpm.24318449/gcj-verifier-hack-patch.html

Getting Started

To get started,

  • Download the above zipfile and unzip it somewhere. I chose C:\Program Files and, for illustration purposes, will assume you did too in the remainder of this document.
  • Either put C:\Program Files\thisiscool-gcc\gcc-3.4\bin in your global path, or ensure that it is in your path when you do a build.
  • For SWT applications, you'll need to move C:\Program Files\thisiscool-gcc\gcc-3.4\i686-pc-mingw32\lib\swt-win32-3054.dll to somewhere your built executable can see it.
  • For dynamic builds, rename one of libgcj.dll.origdll or libgcj.dll.guidll (these are both in C:\Program Files\thisiscool-gcc\gcc-3.4\i686-pc-mingw32\lib) to libgcj.dll and put this somewhere where the built executables can see it.

The bundle includes example applications. See the ReadMe files in thisiscool-gcc and thisiscool-gcc/examples for details.

Questions, Consulting, Custom Builds

See this section.

Developer Distribution

Note: these sources includes the above patches. This is source code only, not the gcc compiler itself. To conserve both  your bandwidth and mine, only download this if you are sure you need it. If you're not sure whether you need this, you probably don't.

GCC/GCJ 4.02

The Bundle

Here is the bundle:

gcc40-20051104.tar.bz2 (63900369 bytes)
(MD5 checksum: 2018bff308f05d60ee3222af8541500b)

Build notes:

http://gcc.gnu.org/ml/java/2005-11/msg00023.html

It includes:

Note: The DLL builds don't allow loading resources from the classpath (the application crashes on startup with an access violation). I haven't looked into this.

Dynamic builds are not supported in this release. Ignore any information in this section about dynamic builds.

Uncommitted Patches

The build contains the following patches discussed in the java and java-patches mailing lists. Be aware that these have not yet been approved and some of them may never be accepted:

Short Description Location
MinGW gcjh correct headers http://gcc.gnu.org/ml/java-patches/2005-q3/msg00400.html
Remove libgcj AWT & Swing Classes diffs/40/noawt402.diff

Getting Started

To get started,

  • Download the above zipfile and unzip it somewhere. I chose C:\Program Files and, for illustration purposes, will assume you did too in the remainder of this document.
  • Either put C:\Program Files\thisiscool-gcc\gcc-4.0\bin in your global path, or ensure that it is in your path when you do a build.
  • For SWT applications, you'll need to move C:\Program Files\thisiscool-gcc\gcc-4.0\i686-pc-mingw32\lib\swt-win32-3138.dll to somewhere your built executable can see it.
  • For dynamic builds, rename one of libgcj.dll.origdll or libgcj.dll.guidll (these are both in C:\Program Files\thisiscool-gcc\gcc-4.0\i686-pc-mingw32\lib) to libgcj.dll and put this somewhere where the built executables can see it.

The bundle includes example applications. See the ReadMe files in thisiscool-gcc and thisiscool-gcc/examples for details.

Questions, Consulting, Custom Builds

See this section.

Developer Distribution

Note: these sources include the above patches. This is source code only, not the gcc compiler itself. To conserve both  your bandwidth and mine, please only download this if you are sure you need it. If you're not sure whether you need this, you probably don't.

GCC/GCJ 4.2

The Bundle

Here is the bundle:

gcc42-20061116.tar.bz2 (130056098 bytes)
(MD5 checksum: bd03c031dd779eb5a6abf16781c56d44)

Build notes:

http://gcc.gnu.org/ml/java/2006-11/msg00044.html

It includes:

  • a build of GCC 4.2 from the 4.2 SVN branch pulled down around 15 November 2006.
  • binutils-2.16.91-20060119-1, w32api-3.5 and mingw-runtime-3.9 from the MingW download page
  • a GCJ build of the Win32 swt.jar (libswt.a which uses swt-win32-3218.dll, shipped with Eclipse 3.2)
  • sample applications (console, SWT)

Note: DLL (shared) builds are not supported in this release. Also, I haven't integrated SWT and SwingWT as I have in previous releases, though a gcj-built SWT (3218) and SWT samples are included in this bundle.

Uncommitted Patches

The build contains the following patches discussed in the java and java-patches mailing lists. Be aware that these have not yet been approved and some of them may never be accepted:

No uncommitted patches! Woo hoo!

Getting Started

To get started,

  • Download the above zipfile and unzip it somewhere. I chose C:\Program Files and, for illustration purposes, will assume you did too in the remainder of this document.
  • Either put C:\Program Files\thisiscool-gcc\gcc-4.2\bin in your global path, or ensure that it is in your path when you do a build.
  • For SWT applications, you'll need to move one or more of the DLLs in C:\Program Files\thisiscool-gcc\swt\win32\3218 to somewhere your built executable can see it/them.

The bundle includes example applications. See the ReadMe files in thisiscool-gcc and thisiscool-gcc/examples for details.

Questions, Consulting, Custom Builds

See this section.

Developer Distribution

Note: these sources include the above patches. This is source code only, not the gcc compiler itself. To conserve both  your bandwidth and mine, please only download this if you are sure you need it. If you're not sure whether you need this, you probably don't.

GCC/GCJ 4.3

The Bundle

Here is the bundle:

gcc43-20061204.tar.bz2 (135920173 bytes)
(MD5 checksum: 94133f65c07b6b5bcbf25e927c06c006)

Build notes:

http://gcc.gnu.org/ml/java/2006-12/msg00078.html

It includes:

  • a build of GCC 4.3 from gcc SVN trunk pulled down around 4 December 2006.
  • binutils-2.16.91-20060119-1, w32api-3.5 and mingw-runtime-3.9 from the MingW download page
  • a GCJ build of the Win32 swt.jar (libswt.a which uses swt-win32-3218.dll, shipped with Eclipse 3.2)
  • sample applications (console, SWT)

Note: DLL (shared) builds are not supported in this release. Also, I haven't integrated SWT and SwingWT as I have in previous releases, though a gcj-built SWT (3218) and SWT samples are included in this bundle.

Uncommitted Patches

The build contains the following patches discussed in the java and java-patches mailing lists. Be aware that these have not yet been approved and some of them may never be accepted:

No uncommitted patches! Woo hoo!

Getting Started

To get started,

  • Download the above zipfile and unzip it somewhere. I chose C:\Program Files and, for illustration purposes, will assume you did too in the remainder of this document.
  • Either put C:\Program Files\thisiscool-gcc\gcc-4.3\bin in your global path, or ensure that it is in your path when you do a build.
  • For SWT applications, you'll need to move one or more of the DLLs in C:\Program Files\thisiscool-gcc\swt\win32\3218 to somewhere your built executable can see it/them.

The bundle includes example applications. See the ReadMe files in thisiscool-gcc and thisiscool-gcc/examples for details.

Questions, Consulting, Custom Builds

See this section.

Developer Distribution

Note: these sources include the above patches. This is source code only, not the gcc compiler itself. To conserve both  your bandwidth and mine, please only download this if you are sure you need it. If you're not sure whether you need this, you probably don't.

GCC/GCJ 4.3 (gcj-eclipse-merge-branch)

The Bundle

Java 5 support with Eclipse's ecj compiler integrated. Cool!

  • generics
  • autoboxing/unboxing
  • extended for loops
  • static imports
  • varargs
  • enumerations
  • annotations

Here is the bundle:

gcc43ecj-20061207.tar.bz2 (125889949 bytes)
(MD5 checksum: 35aae8f877b6a769d534d31fcd2a0e4d)

Build notes:

http://gcc.gnu.org/ml/java/2006-12/msg00127.html

It includes:

  • a build of GCC 4.3 from gcj-eclipse-merge-branch SVN trunk pulled down around 5 December 2006.
  • binutils-2.16.91-20060119-1, w32api-3.5 and mingw-runtime-3.9 from the MingW download page
  • a GCJ build of the Win32 swt.jar (libswt.a which uses swt-win32-3218.dll, shipped with Eclipse 3.2)
  • sample applications (console, SWT)

Note: DLL (shared) builds are not supported in this release. Also, I haven't integrated SWT and SwingWT as I have in previous releases, though a gcj-built SWT (3218) and SWT samples are included in this bundle.

Uncommitted Patches

The build contains the following patches discussed in the java and java-patches mailing lists. Be aware that these have not yet been approved and some of them may never be accepted:

Short Description Location
Configury / ecjx http://gcc.gnu.org/ml/java-patches/2006-q4/msg00221.html
Central Parking http://gcc.gnu.org/ml/java-patches/2006-q4/msg00209.html
Note: This patch is incorrect and will not be approved.

Getting Started

To get started,

  • Download the above zipfile and unzip it somewhere. I chose C:\Program Files and, for illustration purposes, will assume you did too in the remainder of this document.
  • Either put C:\Program Files\thisiscool-gcc\gcc-ecj\bin in your global path, or ensure that it is in your path when you do a build.
  • For SWT applications, you'll need to move one or more of the DLLs in C:\Program Files\thisiscool-gcc\swt\win32\3218 to somewhere your built executable can see it/them.

The bundle includes example applications. See the ReadMe files in thisiscool-gcc and thisiscool-gcc/examples for details.

Questions, Consulting, Custom Builds

See this section.

Developer Distribution

Note: these sources include the above patches. This is source code only, not the gcc compiler itself. To conserve both  your bandwidth and mine, please only download this if you are sure you need it. If you're not sure whether you need this, you probably don't.

Questions, Consulting, Custom Builds

Due to my busy schedule, it is unlikely that I can answer direct emails pertaining to the usage of MinGW gcc and gcj. I am a software developer and consultant, though, and would be happy to help you if you purchase hours of my consulting time. Click here to start a fun, user-friendly wizard where you can do this. There are also flat-rate services you can purchase

I am committed to maintaining and updating this build and providing it for free download for as long as my schedule permits. I promise to never charge money for the download of this build. I am also interested in hearing about bugs in this build. These should first be reported to the gcj mailing list, as discussed shortly.

I can also do custom builds and add functionality as part of my consulting services. I've done this for a client who has released a commercial product using MinGW gcj, with great results. Contact me at the email address above for further details.

You can also try to ask gcj-related questions on the gcj mailing list: http://gcc.gnu.org/ml/java. See this page for signup information. The people there are very friendly and helpful. Keep in mind, though, that they probably won't be able to answer questions that are too Windows-specific or specific to my build.

Licenses

If You Enjoy This...

...would you consider visiting one or more of the following links?:

My thisiscool.com