Ah yes but that patch doesn't actually work in practice. I've been slack on this :(
IIRC the problem with https://go-review.googlesource.com/c/go/+/339370 is that lto causes some of the references in the linked executable to disappear, meaning cgo can't do the analysis it needs to do. It's a shame because it's obviously a much cleaner patch... Cheers, mwh On Sat, 18 Jun 2022 at 02:51, Shengjing Zhu <z...@debian.org> wrote: > On Fri, Jun 17, 2022 at 3:36 PM Matthias Klose <d...@debian.org> wrote: > > > > Package: src:golang-1.18 > > Version: 1.18.3-1 > > Severity: wishlist > > Tags: patch > > > > lto support now landed in dpkg in unstable, now evaluation the > possibility to > > turn on link time optimizations by default. Currently builds fail like: > > > > [...] > > loadelf: $WORK/b101/_pkg_.a(_x001.o): 151068: sym#11 > (g_cgo_export.c.d01d1947): > > ignoring symbol in section 4 (type 0) > > loadelf: $WORK/b101/_pkg_.a(_x002.o): 151072: sym#11 > > (cgo_linux.cgo2.c.e1a05304): ignoring symbol in section 4 (type 0) > > loadelf: $WORK/b101/_pkg_.a(_x003.o): 151077: sym#13 > > (cgo_resnew.cgo2.c.1f334c1b): ignoring symbol in section 5 (type 0) > > loadelf: $WORK/b101/_pkg_.a(_x004.o): 151081: sym#11 > > (cgo_socknew.cgo2.c.00cb1c10): ignoring symbol in section 4 (type 0) > > loadelf: $WORK/b101/_pkg_.a(_x005.o): 151086: sym#13 > (cgo_unix.cgo2.c.81407354): > > ignoring symbol in section 5 (type 0) > > loadelf: $WORK/b108/_pkg_.a(_x001.o): 151068: sym#11 > (g_cgo_export.c.d01d1947): > > ignoring symbol in section 4 (type 0) > > loadelf: $WORK/b108/_pkg_.a(_x002.o): 151093: sym#11 > (cgo.cgo2.c.547524ab): > > ignoring symbol in section 4 (type 0) > > loadelf: $WORK/b108/_pkg_.a(_x003.o): 151098: sym#13 > (gcc_context.c.0c594a6b): > > ignoring symbol in section 5 (type 0) > > loadelf: $WORK/b108/_pkg_.a(_x004.o): 151105: sym#16 > (gcc_fatalf.c.104c99f5): > > ignoring symbol in section 5 (type 0) > > loadelf: $WORK/b108/_pkg_.a(_x005.o): 151116: sym#21 > (gcc_libinit.c.57049a80): > > ignoring symbol in section 5 (type 0) > > loadelf: $WORK/b108/_pkg_.a(_x006.o): 151126: sym#19 > > (gcc_linux_amd64.c.7bb88008): ignoring symbol in section 5 (type 0) > > loadelf: $WORK/b108/_pkg_.a(_x007.o): 151133: sym#16 > (gcc_mmap.c.58726c34): > > ignoring symbol in section 5 (type 0) > > loadelf: $WORK/b108/_pkg_.a(_x008.o): 151138: sym#13 > (gcc_setenv.c.58922dfc): > > ignoring symbol in section 5 (type 0) > > loadelf: $WORK/b108/_pkg_.a(_x009.o): 151143: sym#14 > (gcc_sigaction.c.8c3bca0d): > > ignoring symbol in section 5 (type 0) > > loadelf: $WORK/b108/_pkg_.a(_x010.o): 151148: sym#13 > (gcc_traceback.c.2a322f93): > > ignoring symbol in section 5 (type 0) > > loadelf: $WORK/b108/_pkg_.a(_x011.o): 151156: sym#16 > (gcc_util.c.9bbd18fc): > > ignoring symbol in section 5 (type 0) > > loadelf: $WORK/b108/_pkg_.a(_x012.o): 151161: sym#13 > (linux_syscall.c.96145c1f): > > ignoring symbol in section 5 (type 0) > > _cgo_callers: relocation target x_cgo_callers not defined > > _cgo_init: relocation target x_cgo_init not defined > > _cgo_mmap: relocation target x_cgo_mmap not defined > > _cgo_munmap: relocation target x_cgo_munmap not defined > > /usr/lib/go-1.18/pkg/tool/linux_amd64/link: too many errors > > [...] > > > > > https://patches.ubuntu.com/g/golang-1.18/golang-1.18_1.18.3-1ubuntu1.patch > > > > so please disable these for now and/or forward the issue upstream. > > The patch says it has been forwarded to > https://go-review.googlesource.com/c/go/+/281314 > And on https://go-review.googlesource.com/c/go/+/281314, the comment > says it has been obsoleted by > https://go-review.googlesource.com/c/go/+/339370 > > -- > Shengjing Zhu > >