Hi!

Am Mi., 31. Aug. 2022 um 00:57 Uhr schrieb Steve Langasek
<steve.langa...@canonical.com>:
>
> Package: dh-dlang
> Version: 0.6.5
> Severity: normal
> Tags: patch
> User: ubuntu-de...@lists.ubuntu.com
> Usertags: origin-ubuntu kinetic ubuntu-patch
>
> Hi Matthias,
>
> I noticed in Ubuntu when trying to rebuild most packages against ldc 1.30.0
> that they were now failing to build with current dh-dlang, because including
> /usr/share/dh-dlang/dlang-flags.mk caused dpkg-buildflags' LDFLAGS to be
> exported and these flags are not understood by ldc (specifically:
> -Wl,-Bsymbolic-functions and -Wl,-z,relro on Ubuntu).  This can be seen in
> Debian in the failed build of gir-to-d:
>
> [...]
> ../meson.build:1:0: ERROR: Unable to detect linker for compiler `ldc2 
> -L=--version /tmp/tmpsh_a2h39.d -Wl,-z,relro -O -g -release -wi --allinst`
> stdout:
> stderr: ldc2: Unknown command line argument '-Wl,-z,relro'.  Try: 'ldc2 
> --help'
> ldc2: Did you mean '--icp-lto'?
> [...]
>
>   
> (https://buildd.debian.org/status/fetch.php?pkg=gir-to-d&arch=amd64&ver=0.22.0-3%2Bb1&stamp=1661202072&raw=0)

So, this is actually a Meson regression, that is tracked as
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1017087 and already
fixed upstream, but sadly not yet resolved in Debian.
IMHO the right place to fix this issue is in Meson, and not to work
around it in dh-dlang, because the Meson fix will even work for
packages which don't use dh-dlang, although there also *should* not be
any harm in applying a workaround - however....

> Paradoxically, there is support in dh-dlang for mapping these flags for ldc,
> but this support is not included automatically in dlang-flags.mk.

... AFAIR using this for LDFLAGS caused problems with other D tools (I
specifically recall dub), but this has been long ago and the D
toolchain was much buggier than it is today (yes, even more! :-P), so
maybe that issue was solved...

TBH, I genuinely don't know what the best course of action is here -
obviously we need the Meson regression fixed, but I'm not sure if we
should also apply this patch and possibly thereby mask future problems
(or create new ones, but we'd notice these rather quickly!).

Cheers,
    Matthias

-- 
I welcome VSRE emails. See http://vsre.info/

Reply via email to