SCons and gdc

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Oct 22 11:23:17 PDT 2012


On Mon, Oct 22, 2012 at 07:03:03PM +0100, Russel Winder wrote:
> Hi,
> 
> On Mon, 2012-10-22 at 10:55 -0700, H. S. Teoh wrote:
> […]
> > I've been using Russel's new D tooling to great effect -- it has
> > been working quite well with dmd. However, I'm wondering if there's
> > a way to make it work correctly for gdc (which uses gcc-style
> > command-line syntax)? Currently, it tries to run gdc with dmd-style
> > syntax, which causes object files to be wrongly named (-offilename.o
> > gets interpreted as -o ffilename.o by gdc).
> 
> Uuurrr... the gdc tool should use GCC standard options, and indeed
> fail in DMD/GDMD/LDC style options.  If this is not the case we should
> raise a bug report, create a unit test fail and add it into the code
> base.

Hmm. How does it determine which tool to use? I currently have gdc on a
non-standard path, so my environment looks like:

	env = Environment(
		DC = '/usr/src/d/gdcroot/bin/gdc',
		DFLAGS = ['-O', '-g', '-funittest']
	)

But it is still using dmd-style options on the command line. Is there
some other setting that I need to put in to specifically tell it to use
the GDC tool?


> > A temporary workaround is to use gdmd, of course, but I'd like to be
> > able to access the gcc-style gdc-specific options for my builds.
> […]
> 
> I have to admit to not having tested GDC so much as it isn't 2.060
> compatible as yet, and LDC is, so I am using the ldc tool for the
> moment.
[...]

I've managed to build the gcc-4.7 git branch of GDC, which supports
2.059 (at least), so I've been able to test it on my newer code which
uses some new Phobos features introduced in 2.059. I might try GDC's git
master with gcc-4.8 sometime, now that I figured out how to make things
work on my machine (GCC's build system is extremely fragile and a
nightmare to debug when something goes wrong) -- it should support
2.060.


T

-- 
I'm still trying to find a pun for "punishment"...


More information about the Digitalmars-d mailing list