https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/ Issue: app-i18n/xvnkb-0.2.11 fails to compile (lto). Discovered on: amd64 (internal ref: lto_tinderbox) NOTE: This machine uses lto with CFLAGS=-flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing
Created attachment 788129 [details] build.log build log and emerge --info
Error(s) that match a know pattern in addition to what has been reported in the summary: /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: <artificial>:(.text+0xa50): undefined reference to `VKAllocColorName' /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: <artificial>:(.text+0xa63): undefined reference to `VKAllocColorName' /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: <artificial>:(.text+0xa76): undefined reference to `VKAllocColorName' /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: <artificial>:(.text+0xa89): undefined reference to `VKAllocColorName' /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: <artificial>:(.text.startup+0x855): undefined reference to `VKAllocColorName' /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: <artificial>:(.text.startup+0x868): undefined reference to `VKAllocColorName' /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: <artificial>:(.text.startup+0x87b): undefined reference to `VKAllocColorName' /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: <artificial>:(.text.startup+0x88e): undefined reference to `VKAllocColorName' <artificial>:(.text+0xa3d): undefined reference to `VKAllocColorName' <artificial>:(.text.startup+0x842): undefined reference to `VKAllocColorName' collect2: error: ld returned 1 exit status
After fixing bug 886069 I can actually compile this with gcc, and cannot reproduce the LTO issue... the version hasn't changed. The only references to VKAllocColorName in the source code: /var/tmp/portage/app-i18n/xvnkb-0.2.11/work/xvnkb-0.2.11/xresource.c 137:inline void VKAllocColorName(char *name, ulong *color) 156: VKAllocColorName("red", &clRed); 157: VKAllocColorName("yellow", &clYellow); 158: VKAllocColorName("white", &clWhite); 159: VKAllocColorName("black", &clBlack); 160: VKAllocColorName("blue", &clBlue); 161: VKAllocColorName("gray", &clGray); 162: VKAllocColorName("SteelBlue", &clMenuBar); So it's not clear to me why this would ever error... something something inline rules / a compiler bug? Pretty sure no one cares enough to try bisecting the gcc-12 release branch to see if somewhere along the line this got fixed.
It might be a good idea for the code to use static inline instead... perhaps if someone had a way to communicate with upstream, which is unfortunately silent for 9 years so good luck with that.