Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 854675

Summary: app-i18n/xvnkb-0.2.11 fails to compile (lto): undefined reference to VKAllocColorName
Product: Gentoo Linux Reporter: Agostino Sarubbo <ago>
Component: Current packagesAssignee: CJK Team <cjk>
Status: RESOLVED WORKSFORME    
Severity: normal CC: eschwartz93
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 618550    
Attachments: build.log

Description Agostino Sarubbo gentoo-dev 2022-06-27 19:57:23 UTC
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
Comment 1 Agostino Sarubbo gentoo-dev 2022-06-27 19:57:25 UTC
Created attachment 788129 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2022-06-27 19:57:27 UTC
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
Comment 3 Eli Schwartz 2024-03-03 07:02:30 UTC
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.
Comment 4 Eli Schwartz 2024-03-03 07:04:59 UTC
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.