Created attachment 517122 [details] emerge --info After an emerge -e @world, /ocl-icd fails to build. Most probably due to gcc-7.3.0, 'cause I didn't change anything else in the toolchain.
Created attachment 517124 [details] build.log
By chance I figured out what was causing the bug. dev-libs/ocl-icd-2.2.11 does not like "-Os". Setting CFLAGS back to "-O2" makes it build again.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b9fac3ab728ed3a7c0e40a69dae16681de89f5d5 commit b9fac3ab728ed3a7c0e40a69dae16681de89f5d5 Author: Matt Turner <mattst88@gentoo.org> AuthorDate: 2018-10-08 13:09:05 +0000 Commit: Matt Turner <mattst88@gentoo.org> CommitDate: 2018-10-08 15:43:13 +0000 dev-libs/ocl-icd: Version bump to 2.2.12 Closes: https://bugs.gentoo.org/637964 Closes: https://bugs.gentoo.org/646122 Signed-off-by: Matt Turner <mattst88@gentoo.org> dev-libs/ocl-icd/Manifest | 1 + dev-libs/ocl-icd/ocl-icd-2.2.12.ebuild | 45 ++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+)
Created attachment 558586 [details, diff] use static inline Proper fix would be to change the "inline" to "static inline". With inline the compiler can choose whether to inline or not, it's only a hint. It does so at -O2 but does not at -Os. When it doesn't inline the function the symbol doesn't get resolved during linking unless provided elsewhere. Using "static inline" ensures the function is also emitted in the local object scope whether inlined or not. I've been using this patch in my gentoo-gpu Overlay for ages.
This old issue came up on the forums because user was missing -O2 (was building with no -O at all), so the issue is not limited to -Os. It may be worth revisiting for a proper fix like the previous comment suggested. Things breaking with more optimizations is nothing special but breaking with less seems fickle and will likely cause more problems down the line as compilers and optimizations change. https://forums.gentoo.org/viewtopic-t-1118014.html