Using up-to-date GDC [was Re: Swift is based LLVM,what will the D's LDC do?]

Iain Buclaw via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 4 23:49:53 PDT 2014


On 5 June 2014 06:30, Russel Winder via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> On Wed, 2014-06-04 at 20:25 +0100, Iain Buclaw via Digitalmars-d wrote:
> […]
>> I have an OSX box to start porting.  But there's a couple druntime
>> related problems I need to have a proper sit down about.  These are
>> mostly TLS-related problems.  DMD insists on doing something wildly
>> different for each target.  I insist on having a common way of doing
>> everything.
>>
>> Once builds start succeeding, they will come.
>
> LDC is (relatively) easy to build: for Git repository, run cmake for
> each platform to create platform specific builds, run (make clean &&
> make && make install && make clean).
>
> Is there a similarly easy way of building GDC?
>

I don't think there exists a *works for all* method of doing it, but there is:

http://wiki.dlang.org/GDC/Installation/Generic

Which is only good so you understand the general reasoning for the
process, what switches mean, etc.


The dummies guide to building GDC would be:

1. Install prerequesites:  libmpc-dev libmpfr-dev libgmp3-dev flex
bison autoconf automake patch git g++
2. Download GCC (ie: 4.9.0) release sources from:
https://gcc.gnu.org/mirrors.html
3. Download stable GDC sources:
gdcproject.org/downloads/sources/gdc-4.9-src.tar.xz
4. Extract GCC, then GDC into separate directories.
5. Inside GDC, run  ./setup-gcc.sh ../path-to-gcc-xxx
6. Create a new directory for building, eg:  mkdir objdir
7. Inside the build directory, run:
  ../path-to-gcc-xxx/configure --prefix=/usr --enable-languages=d
--enable-checking=release --disable-bootstrap
--with-bugurl="http://bugzilla.gdcproject.org"
8. Run make
9. Make a coffee
10. Run make install, eg:  DESTDIR=~/.local make install
11. Optionally, check your installation with:  make check-d

The most logic really goes into setting up your environment, obtaining
sources, and structuring the folders correctly for building.  The
*actual* build process itself is painless if it goes through without
errors.


> Building and using the very latest version of compilers, and reporting
> any issues, is a very easy way for me to chip in some effort.
>
> (For DMD though I am just lazy, I take whatever is on D-Apt for Debian,
> manually install release RPMs for Fedora – why isn't there a version of
> D in RPMFusion? – and whatever is in MacPorts for OSX.)

Don't quote me, but the only way distributions can ship DMD is via a
script that does a download from dlang.org, extract, install process
(like eg: flashplayer).

GDC has never landed in Fedora because they have refused to have a 3rd
party front-end the last time - using GNU Pascal Compiler (no longer
maintained iirc) as a previous example.  And I think the macport
binaries are ancient?  I certainly found it a bit odd to set-up my
build environment for building gcc-4.9 on OSX, but then again I'm not
an OSX geek, things that seem odd to me might seem the right way to do
it for others.  :o)



More information about the Digitalmars-d mailing list