Comment 2 for bug 2002076

Revision history for this message
Shengjing Zhu (zhsj) wrote :

The best is to write a smart regexp in dpkg. Or just workaround(yeah, workaround on workarund, the lto strip is already a workaround) like:

```
diff -Nru dh-golang-1.59/lib/Debian/Debhelper/Buildsystem/golang.pm dh-golang-1.59ubuntu1/lib/Debian/Debhelper/Buildsystem/golang.pm
--- dh-golang-1.59/lib/Debian/Debhelper/Buildsystem/golang.pm 2022-09-25 11:28:07.000000000 +0000
+++ dh-golang-1.59ubuntu1/lib/Debian/Debhelper/Buildsystem/golang.pm 2023-01-06 09:59:50.000000000 +0000
@@ -380,6 +380,8 @@
     foreach my $flag (@flags) {
         if (! exists $ENV{"CGO_" . $flag}) {
             $bf->strip($flag, "-ffat-lto-objects -flto=auto");
+ # strip twice to workaround #1028044
+ $bf->strip($flag, "-ffat-lto-objects -flto=auto");
             # https://golang.org/issues/54313
             # https://github.com/golang/go/commit/365ca694
             $bf->strip($flag, "-fstack-protector-strong");
```