Hi!

On Fri, 2026-01-16 at 20:51:59 +0100, Guillem Jover wrote:
> On Fri, 2026-01-16 at 17:58:40 +0100, Emanuele Rocca wrote:
> > Control: reassign -1 dpkg-dev
> > Control: retitle -1 dpkg-buildflags adds branch-protection to LDFLAGS
> > 
> > On 2026-01-16 04:57, Sebastian Ramacher wrote:
> > > ../meson.build:1:0: ERROR: Unable to detect linker for compiler `ldc2 
> > > -L=--version /tmp/tmpp57y3ut8.d -L=-z -L=relro 
> > > -mbranch-protection=standard -release -wi -g -O2`
> > > stdout: 
> > > stderr: ldc2: Unknown command line argument 
> > > '-mbranch-protection=standard'.  Try: 'ldc2 --help'
> > > ldc2: Did you mean '--fcf-protection=standard'?
> > 
> > It seems that dpkg-buildflags erroneously started adding to LDFLAGS
> > -mbranch-protection=standard, while that is not a linker argument.
> 
> Hmm, according to #1115292 (commit cdf5f5da0e0cb6f9f4d51e93fd9583bd578c252f)
> this is needed to avoid warnings from the compiler. Was that analysis
> wrong somehow?
> 
> At this point all options seem pretty bad to me. :/

This one is related to #1125323, and they could be merged, but
depending on the outcome about the initial analysis on whether
these hardening flags might be incorrect, then a fix for this report
might be to simply stop adding them, otherwise, right now I don't
know really. :/

Also it's not clear to me whether this would affect all D packages or
just a few ones, for example (given the error message) perhaps only the
ones using meson as build system, where I see it might be trying to
infer the direct linker calls based on the gcc calls? Checking briefly
on meson I see that mesonbuild/compilers/d.py looks suspect, and might
potentially need to be updated perhaps?

And, if the hardening calls are fine as is, and this is confirmed to
be a problem only in meson (for example), then I'd also be fine with
potentially reverting the dpkg LDFLAGS additions (temporarily) in case
it currently affects lots of packages and we'd need to wait for either
those packages to get fixed or for, say, meson to be fixed.

Thanks,
Guillem

Reply via email to