Bug 462084 - Frameworks-syntax-highlighting: Build failed using clang 15
Summary: Frameworks-syntax-highlighting: Build failed using clang 15
Status: RESOLVED DOWNSTREAM
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: framework (show other bugs)
Version: 5.100.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-21 02:21 UTC by krismanmathers
Modified: 2023-02-03 07:18 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.102.0


Attachments
Full build log (1.62 MB, text/x-log)
2022-11-21 02:21 UTC, krismanmathers
Details
version 5.101.0 w/ clang 15.0.7 build log (235.96 KB, text/x-log)
2023-01-18 10:41 UTC, krismanmathers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description krismanmathers 2022-11-21 02:21:29 UTC
Created attachment 153913 [details]
Full build log

SUMMARY

kde-frameworks/syntax-highlighting failed to build with clang

[101/139] cd /var/tmp/portage/kde-frameworks/syntax-highlighting-5.100.0/work/syntax-highlighting-5.100.0_build/data && /var/tmp/portage/kde-frameworks/syntax-highlighting-5.100.0/work/syntax-highlighting-5.100.0_build/bin/katehighlightingindexer /var/tmp/portage/kde-frameworks/syntax-highlighting-5.100.0/work/syntax-highlighting-5.100.0_build/data/index.katesyntax /var/tmp/portage/kde-frameworks/syntax-highlighting-5.100.0/work/syntax-highlighting-5.100.0/data/schema/language.xsd /var/tmp/portage/kde-frameworks/syntax-highlighting-5.100.0/work/syntax-highlighting-5.100.0_build/data/syntax-data.qrc
^[[31mFAILED: ^[[0mdata/index.katesyntax /var/tmp/portage/kde-frameworks/syntax-highlighting-5.100.0/work/syntax-highlighting-5.100.0_build/data/index.katesyntax
cd /var/tmp/portage/kde-frameworks/syntax-highlighting-5.100.0/work/syntax-highlighting-5.100.0_build/data && /var/tmp/portage/kde-frameworks/syntax-highlighting-5.100.0/work/syntax-highlighting-5.100.0_build/bin/katehighlightingindexer /var/tmp/portage/kde-frameworks/syntax-highlighting-5.100.0/work/syntax-highlighting-5.100.0_build/data/index.katesyntax /var/tmp/portage/kde-frameworks/syntax-highlighting-5.100.0/work/syntax-highlighting-5.100.0/data/schema/language.xsd /var/tmp/portage/kde-frameworks/syntax-highlighting-5.100.0/work/syntax-highlighting-5.100.0_build/data/syntax-data.qrc
"/var/tmp/portage/kde-frameworks/syntax-highlighting-5.100.0/work/syntax-highlighting-5.100.0/data/syntax/4dos.xml" line 875 unknown context "#pop!ColorHaveBG" in "ColorBG"
"/var/tmp/portage/kde-frameworks/syntax-highlighting-5.100.0/work/syntax-highlighting-5.100.0/data/syntax/4dos.xml" line 879 unknown context "#pop!ColorNeedBordercol" in "ColorHaveBG"

"/var/tmp/portage/kde-frameworks/syntax-highlighting-5.100.0/work/syntax-highlighting-5.100.0/data/syntax/4dos.xml" line 865 unknown context "#pop!ColorHaveFG" in "ColorHaveBlinkFG"
"/var/tmp/portage/kde-frameworks/syntax-highlighting-5.100.0/work/syntax-highlighting-5.100.0/data/syntax/4dos.xml" line 860 unknown context "#pop!ColorHaveBlinkFG" in "ColorHaveBrightFG"
"/var/tmp/portage/kde-frameworks/syntax-highlighting-5.100.0/work/syntax-highlighting-5.100.0/data/syntax/4dos.xml" line 870 unknown context "#pop!ColorBG" in "ColorHaveFG"
"/var/tmp/portage/kde-frameworks/syntax-highlighting-5.100.0/work/syntax-highlighting-5.100.0/data/syntax/4dos.xml" line 884 unknown context "#pop!popNeedEndOfCommand" in "ColorNeedBordercol"
"/var/tmp/portage/kde-frameworks/syntax-highlighting-5.100.0/work/syntax-highlighting-5.100.0/data/syntax/4dos.xml" line 664 unknown context "#pop!Redirection" in "RedirectionInput1st"

*more hundreds unknown context

STEPS TO REPRODUCE
1. Install and build with clang

EXPECTED RESULT
Succesful build.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.26.3
KDE Frameworks Version: 5.100.0
Qt Version: 5.15.5
Comment 1 Christoph Cullmann 2023-01-14 20:47:21 UTC
This looks like a broken index executable

 -march=native -O3 -pipe -falign-functions=32 -flto=thin -fomit-frame-pointer -fno-math-errno -fno-trapping-math -mllvm -polly -mllvm -polly-run-dce -mllvm -polly-run-inliner -mllvm -polly-ast-use-context -mllvm -polly-detect-keep-going -mllvm -polly-vectorizer=stripmine -mllvm -polly-invariant-load-hoisting -fPIC -D_FORTIFY_SOURCE=2 -fstack-clash-protection -fstack-protector-strong -ffunction-sections -fdata-sections -Wformat -Werror=format-security -fno-operator-names -fno-exceptions -Wno-gnu-zero-variadic-macro-arguments -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -Werror=init-self -Werror=undef -Wvla -Wdate-time -pedantic -Wzero-as-null-pointer-constant -fdiagnostics-color=always -Wl,--enable-new-dtags -march=native -flto=thin -Wl,--lto-O3,-O3,--as-needed,--gc-sections,--icf=safe,-zrelro,-znow -pie 

Perhaps one of your interesting optimization flags is the reason, but that doesn't look like a fault in our code.

Please try it with a less aggressive optimization level.
Comment 2 krismanmathers 2023-01-18 10:39:25 UTC
Looks like version 5.101.0 build fine using clang 15.0.7
Comment 3 krismanmathers 2023-01-18 10:41:41 UTC
Created attachment 155399 [details]
version 5.101.0 w/ clang 15.0.7 build log
Comment 4 krismanmathers 2023-01-18 11:22:12 UTC
v5.102.0 also built fine
Comment 5 Christoph Cullmann 2023-01-18 11:41:56 UTC
v5.102.0 also built fine

then this is fixed, thanks for testing
Comment 6 krismanmathers 2023-01-18 11:50:35 UTC
(In reply to Christoph Cullmann from comment #5)
> v5.102.0 also built fine
> 
> then this is fixed, thanks for testing

you're welcome :)
Comment 7 Andreas Sturmlechner 2023-01-21 20:18:56 UTC
That's because of a workaround in downstream Qt: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=92c1834342000220f71cf7e9b9ad0ed111d9e084
Comment 8 Sam James 2023-02-03 07:18:32 UTC
At this point, I suspect it's a bug in Clang's implementation of -fstack-clash-protection, given we've seen some odd behaviour with Chromium too. GCC's implementation of stack clash protection works fine. We've stopped enabling it by default for Clang.