#939833 default-d-compiler pointing to gdc doesn't understand the "-main" option

Package:
default-d-compiler
Source:
dh-dlang
Description:
Default D compiler (metapackage)
Submitter:
Matthias Klose
Date:
2025-08-17 17:48:30 UTC
Severity:
important
Tags:
#939833#5
Date:
2019-09-09 11:27:34 UTC
From:
To:
default-d-compiler pointing to gdc doesn't understand the "-main" option,
causing build failures on at least, armhf and s390x during the link step with
the gdc command.

#939833#10
Date:
2019-09-09 12:07:17 UTC
From:
To:
reassign 939833 gdc-9
severity 939833 important
thankyou

Am Mo., 9. Sept. 2019 um 13:30 Uhr schrieb Matthias Klose <doko@debian.org>:

That's not a problem with the metapackage, it is an issue with gdc not
having any such option, like DMD or LDC have.
Fortunately, this is an issue that can be worked around trivially,
I'll submit a patch to the Meson buildsystem to fix this and also
apply one for some of the affected packages later.

Cheers,
    Matthias

#939833#25
Date:
2019-09-09 12:44:31 UTC
From:
To:
clone 939833 -1
reassign 939833 default-d-compiler
thanks


CCing Iain ...

I don't think this is the appropriate action here.  The GCC driver is used for
all frontends in GCC, and there won't be an option just for the D frontend in GCC.

My understanding of the default-d-compiler package is that it is an abstraction
of a D compiler driver, and that it should help with that.  It's nice if you
want to put support into meson, but this should be handled at the root (and no,
I don't mean in ldc or gdc itself).

It seems to me that the correct solution is to have a ldc script doing the
option mangling for build systems other than meson.  Handling gdc as a second
class citizen is not the right way to go, from my point of view.

Matthias

#939833#30
Date:
2019-09-09 13:17:59 UTC
From:
To:
Am Mo., 9. Sept. 2019 um 14:44 Uhr schrieb Matthias Klose <doko@debian.org>:

There could be an -fmain flag, just like there is one for the
D-specific -funittest.
setting the default D compiler for specific architectures in Debian,
which is either LDC or GDC. This is needed because libraries compiled
with GDC can't be used from LDC-compiled code and vice versa. So in
Debian we would either have to compile all D libraries with all D
compilers available on a given architecture (impractical) or just set
one D compiler to be "the one" that stuff is compiled with on that
particular architecture.
That is the purpose of default-d-compiler: It basically says that if
you want to link against Debian D libraries on your current
architecture, use the compiler the metapackage depends on.

I would love for LDC to just support all the GNU-style flags, that
would save a lot of work. Sadly, that isn't the case and not a
priority for LDC upstream. So the dh-dlang package already contains
some abstraction to convert GCC flags to LDC ones, Meson abstracts all
D flags fully (with only -main being an exception), and wrappers like
gdmd and ldmd exist to translate DMD flags to GDC and LDC flags
respectively.
It's a huge mess, and I am quite unhappy with it, but it's also
something that build systems like dub and Meson can deal with.

Cheers,
    Matthias