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)

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

I've applied the attached patch in Ubuntu, which fixes the build problem.

Thanks for considering,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                   https://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org
diff -Nru dh-dlang-0.6.5build2/dlang-flags.mk 
dh-dlang-0.6.5ubuntu1/dlang-flags.mk
--- dh-dlang-0.6.5build2/dlang-flags.mk 2019-09-29 12:14:32.000000000 -0700
+++ dh-dlang-0.6.5ubuntu1/dlang-flags.mk        2022-08-30 10:09:35.000000000 
-0700
@@ -34,5 +34,8 @@
         endif
     endif
 endif
+
+include /usr/share/dh-dlang/ldc-transform-ldflags.mk
+
 export DFLAGS
 export DC

Reply via email to