Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 854675 - app-i18n/xvnkb-0.2.11 fails to compile (lto): undefined reference to VKAllocColorName
Summary: app-i18n/xvnkb-0.2.11 fails to compile (lto): undefined reference to VKAllocC...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: CJK Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2022-06-27 19:57 UTC by Agostino Sarubbo
Modified: 2024-03-03 07:05 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,56.50 KB, text/plain)
2022-06-27 19:57 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
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.