www.digitalmars.com         C & C++   DMDScript  

D.gnu - MinGW GCC 4.8 with GDC

reply Daniel Green <venix1 gmail.com> writes:
I got GDC working with GCC 4.8 on MinGW.  You can find it at

https://bitbucket.org/goshawk/gdc/downloads/GCC-4.8-MinGW-GDC-.7z

A couple of notable things.  It's ALPHA quality.  If it works, you're 
lucky.  You'll find regressions.  The patches required to fix some of 
the past bugs haven't been transferred yet.

It also fails the following DMD testsuite tests.

a20 argufilem bitops bug9010 constfold cov2 ctorpowtests eh
hello-profile nested sdtor sieve template9 test23 test34
test36 test4 test42 testdstress testmodule testsafe
testsocket testthread variadic xtest46

ddoc12 inlineheader inlinexheader line

Currently, there is no build script.  You'll need to recompile all 
dependencies manually.

It's standalone.  It is no longer required to have TDM or any other 
variant of MinGW installed prior.  This increases the size of the 
package.  Also, there's no optimization flags being used.  So everything 
is bigger as well.

It's only 32-bit.  64-bit forthcoming.

README / Build instructions
---------------------------

For Phobos licensing see phobolicense.txt.
For GDC licensing see gpl.txt.

Installation:

This is a self contained MinGW release.  Extract GDC folder to directory 
of choice.


Building:



** Deviating from the versions specified may cause intended 
consequences. ie: Build failures, random crashes **

Ensure fstab as the following entry.  Substitute C: for drive of 
choice(Should work)

C:/crossdev /crossdev

Download the following packages:

binutils-2.23.1.tar.gz
cloog-0.18.0.tar.gz
gcc-4.8-20130303.tar.bz2
gmp-4.3.2.tar.bz2
isl-0.11.1.tar.bz2
mingwrt-3.20-mingw32-src.tar.gz
mpc-1.0.1.tar.gz
mpfr-3.1.1.tar.bz2
w32api-3.17-2-mingw32-src.tar.lzma

Clone GDC.  The checkout version is what I have the patches will 
properly compile.

git clone https://github.com/D-Programming-GDC/GDC.git
git checkout 166e02c2e99c3f6926513bb617593f24b7f4456f

Extract the download files to a directory called src.

Build in this order.  All commands are assumed ran from a directory called
build within the respective source directory

GMP
---
../configure  --prefix=/crossdev/gdc/deps/gmp --disable-shared
make && make install


MPFR
----
../configure --prefix=/crossdev/gdc/deps/mpfr 
--with-gmp=/crossdev/gdc/deps/gmp --disable-shared
make && make install


MPC
---
../configure --prefix=/crossdev/gdc/deps/mpc 
--with-gmp=/crossdev/gdc/deps/gmp --with-mpfr=/crossdev/gdc/deps/mpfr/ 
--disable-shared
make && make install


ISL
---
../configure --prefix=/crossdev/gdc/deps/isl --disable-shared 
--with-gmp-prefix=/crossdev/gdc/deps/gmp
make && make install

CLOOG
-----
../configure --prefix=/crossdev/gdc/deps/cloog --with-bits=gmp 
--disable-shared --with-gmp=build --with-gmp-prefix=/crossdev/gdc/deps/gmp
make && make install

Binutils
--------
Apply patch mingw-tls-binutils-2.23.1.patch
../configure --prefix=/crossdev/gdc/release
make && make install

MinGWRT
-------
Apply patch mingwrt_gdc.patch.
  - Fixes %lf conversion issues.(Causes problems with 2^^4 expressions)
  - Fixes TLS offset by 1 problems
../configure --prefix=/crossdev/gdc/release
make && make install

Win32 API
---------
../configure --prefix=/crossdev/gdc/release
make && make install

GCC
---
Apply patch mingw-tls-gcc-4.8.patch.
  - Fixes SJLJ exception issue
  - Adds TLS support
export GCC_PREFIX="/crossdev/gdc/install"

export PATH="$GCC_PREFIX/bin:$PATH"
../configure --prefix=$GCC_PREFIX --with-gmp=/crossdev/gdc/deps/gmp 
--with-mpfr=/crossdev/gdc/deps/mpfr \
--with-mpc=/crossdev/gdc/deps/mpc --with-cloog=/crossdev/gdc/deps/cloog/ 
--with-isl=/crossdev/gdc/deps/isl \
--disable-bootstrap --enable-languages=c,c++,d,lto --enable-sjlj-exceptions
Mar 30 2013
next sibling parent reply Daniel Green <venix1 gmail.com> writes:
Forgot GIT instructions.

For GDC, you can clone the Master branch. You'll have to manually 
specify which commit.

git clone https://github.com/D-Programming-GDC/GDC.git
git checkout 166e02c2e99c3f6926513bb617593f24b7f4456f
Apply patch mingw-gdc.patch
Mar 30 2013
parent "Iain Buclaw" <ibuclaw ubuntu.com> writes:
On Saturday, 30 March 2013 at 23:22:57 UTC, Daniel Green wrote:
 Forgot GIT instructions.

 For GDC, you can clone the Master branch. You'll have to 
 manually specify which commit.

 git clone https://github.com/D-Programming-GDC/GDC.git
 git checkout 166e02c2e99c3f6926513bb617593f24b7f4456f
 Apply patch mingw-gdc.patch
Sweet work Daniel. Regards Iain
Mar 31 2013
prev sibling next sibling parent reply "Jack Applegame" <japplegame gmail.com> writes:
Which version of MinGW did you use for compilation? TDM/MinGW-w64 
or something else?

I consider MinGW-builds 
(http://sourceforge.net/projects/mingwbuilds/) is the best MinGW 
pack.
Apr 03 2013
parent Daniel Green <venix1 gmail.com> writes:
On 04/03/2013 05:44 PM, Jack Applegame wrote:
 Which version of MinGW did you use for compilation? TDM/MinGW-w64 or
 something else?
 
 I consider MinGW-builds (http://sourceforge.net/projects/mingwbuilds/)
 is the best MinGW pack.
 
I used standard MinGW http://mingw.org for compilation. It's GCC 4.7 and includes the MSYS environment required to build GCC.
Apr 05 2013
prev sibling parent reply "scriptjunkie" <scriptjunkie scriptjunkie.us> writes:
When you say

 Download the following packages:

 binutils-2.23.1.tar.gz
 cloog-0.18.0.tar.gz
 gcc-4.8-20130303.tar.bz2
 gmp-4.3.2.tar.bz2
 isl-0.11.1.tar.bz2
 mingwrt-3.20-mingw32-src.tar.gz
 mpc-1.0.1.tar.gz
 mpfr-3.1.1.tar.bz2
 w32api-3.17-2-mingw32-src.tar.lzma
Where do I get those packages? I don't see them all in the MinGW Installation Manager. Sorry, more of a linux guy and not familiar with MinGW. Also, it would be super-helpful if these instructions were in the README in the repository, as it took me a while to find them here.
Jul 28 2014
parent reply Johannes Pfau <nospam example.com> writes:
Am Mon, 28 Jul 2014 13:34:45 +0000
schrieb "scriptjunkie" <scriptjunkie scriptjunkie.us>:

 When you say
 
 Download the following packages:

 binutils-2.23.1.tar.gz
 cloog-0.18.0.tar.gz
 gcc-4.8-20130303.tar.bz2
 gmp-4.3.2.tar.bz2
 isl-0.11.1.tar.bz2
 mingwrt-3.20-mingw32-src.tar.gz
 mpc-1.0.1.tar.gz
 mpfr-3.1.1.tar.bz2
 w32api-3.17-2-mingw32-src.tar.lzma
Where do I get those packages? I don't see them all in the MinGW Installation Manager. Sorry, more of a linux guy and not familiar with MinGW. Also, it would be super-helpful if these instructions were in the README in the repository, as it took me a while to find them here.
These are source packages, you'll have to get them from their official webpages (https://ftp.gnu.org/gnu/binutils/ , ...) I think these build instructions used to be on the GDC wiki, but I think there's no up-to-date guide right now. If you want to build on windows, this might help: https://github.com/venix1/MinGW-GDC Otherwise I recommend using the binaries from dgnu.org/downloads or building with crosstool-NG:
Jul 28 2014
parent Johannes Pfau <nospam example.com> writes:
Am Mon, 28 Jul 2014 19:02:48 +0200
schrieb Johannes Pfau <nospam example.com>:

 Am Mon, 28 Jul 2014 13:34:45 +0000
 schrieb "scriptjunkie" <scriptjunkie scriptjunkie.us>:
 
 When you say
 
 Download the following packages:

 binutils-2.23.1.tar.gz
 cloog-0.18.0.tar.gz
 gcc-4.8-20130303.tar.bz2
 gmp-4.3.2.tar.bz2
 isl-0.11.1.tar.bz2
 mingwrt-3.20-mingw32-src.tar.gz
 mpc-1.0.1.tar.gz
 mpfr-3.1.1.tar.bz2
 w32api-3.17-2-mingw32-src.tar.lzma
Where do I get those packages? I don't see them all in the MinGW Installation Manager. Sorry, more of a linux guy and not familiar with MinGW. Also, it would be super-helpful if these instructions were in the README in the repository, as it took me a while to find them here.
These are source packages, you'll have to get them from their official webpages (https://ftp.gnu.org/gnu/binutils/ , ...) I think these build instructions used to be on the GDC wiki, but I think there's no up-to-date guide right now. If you want to build on windows, this might help: https://github.com/venix1/MinGW-GDC Otherwise I recommend using the binaries from dgnu.org/downloads or building with crosstool-NG:
http://wiki.dlang.org/GDC/Cross_Compiler/crosstool-NG https://github.com/jpf91/gdc-build-configs/
Jul 28 2014