Package: libdpkg-perl
Version: 1.21.13
Severity: normal
X-Debbugs-Cc: z...@debian.org

Given input `-flto=auto -flto=auto`, $bf->strip($flag, "-flto=auto") returns
`-flto=auto`.
However if given `-flto=auto -ffat-lto-objects -flto=auto`, it will return
`-ffat-lto-objects`. (two -flto=auto are tripped)

I read the code has `g` in regexp, so I think you want to strip duplicated
flag. But the regexp pattern is bit buggy when two duplicated flags are 
together.

Background:

In dh-golang, I use $bf->strip to strip lto flags
https://salsa.debian.org/go-team/packages/dh-golang/-/merge_requests/18

It works for a while in Debian. But I found Ubuntu still carries an LTO
patch in the Go compiler. Then I wonder whether my dh-golang hack doesn't
work for them.

In Ubuntu, for unknown reason, their dpkg-buildflags gives a duplicated lto
flags. `-flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects`.
After $bf->strip($flag, "-ffat-lto-objects -flto=auto"), it becomes 
`-flto=auto`.
Still one lto flag left...

Reply via email to