Activity log for bug #2002076

Date Who What changed Old value New value Message
2023-01-06 07:27:43 Shengjing Zhu bug added bug
2023-01-06 07:35:15 Shengjing Zhu description In dh-golang, we use dpkg's C flags as Go's CGO flags. When dpkg's LTO feature is enabled, the LTO C flags may pass to CGO as well. But Go's linker doesn't support LTO. So in dh-golang, we implemented a workround to strip LTO flag[1]. [1] https://salsa.debian.org/go-team/packages/dh-golang/-/commit/501517bca24c155bdd3ed706ad413a22c625c7a8 ``` $bf->strip($flag, "-ffat-lto-objects -flto=auto"); ``` This works well in Debian, but it turns out not robust for Ubuntu. In Ubuntu, we get such C flags: ``` $ dpkg-buildflags --get CFLAGS -g -O2 -ffile-prefix-map=[retracted]=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security ``` It has two duplicated `-flto=auto -ffat-lto-objects`. So dh-golang's code doesn't handle it robustly. One `-flto=auto -ffat-lto-objects` set is still passed to CGO. This causes link error. In dh-golang, we use dpkg's C flags as Go's CGO flags. When dpkg's LTO feature is enabled, the LTO C flags may pass to CGO as well. But Go's linker doesn't support LTO. So in dh-golang, we implemented a workround to strip LTO flag[1]. [1] https://salsa.debian.org/go-team/packages/dh-golang/-/commit/501517bca24c155bdd3ed706ad413a22c625c7a8 ``` $bf->strip($flag, "-ffat-lto-objects -flto=auto"); ``` This works well in Debian, but it turns out not robust for Ubuntu. In Ubuntu, we get such C flags: ``` $ dpkg-buildflags --get CFLAGS -g -O2 -ffile-prefix-map=[redacted]=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security ``` It has two duplicated `-flto=auto -ffat-lto-objects`. So dh-golang's code doesn't handle it robustly. One `-flto=auto -ffat-lto-objects` set is still passed to CGO. This causes link error.
2023-01-06 08:35:12 Shengjing Zhu bug task added dpkg (Ubuntu)
2023-01-06 09:35:31 Shengjing Zhu tags fr-3163
2023-01-06 10:09:32 Shengjing Zhu bug watch added https://golang.org/issues/54313
2023-01-06 12:54:27 Julian Andres Klode bug watch removed https://golang.org/issues/54313
2023-01-09 08:42:17 Shengjing Zhu bug watch added https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1028044
2023-01-10 02:01:33 Shengjing Zhu dh-golang (Ubuntu): status New Invalid
2023-01-16 02:05:29 Shengjing Zhu dpkg (Ubuntu): status New Fix Committed
2023-02-10 14:20:43 Shengjing Zhu dpkg (Ubuntu): status Fix Committed Fix Released