Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 910365 - dev-qt/qtshadertools-6.5.1 fails to compile (lto): src/shadertools/../3rdparty/glslang/SPIRV/spirv.hpp:441:6: error: type ‘spv::Decoration’ violates the C++ One Definition Rule [-Werror=odr]
Summary: dev-qt/qtshadertools-6.5.1 fails to compile (lto): src/shadertools/../3rdpart...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2023-07-14 18:26 UTC by Kostadin Shishmanov
Modified: 2023-08-06 20:37 UTC (History)
0 users

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


Attachments
build log (build.log,120.25 KB, text/plain)
2023-07-14 18:26 UTC, Kostadin Shishmanov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kostadin Shishmanov 2023-07-14 18:26:18 UTC
Created attachment 865506 [details]
build log

dev-qt/qtshadertools-6.5.1 fails to compile with LTO and -Werror=odr

/mnt/tmp/portage/dev-qt/qtshadertools-6.5.1/work/qtshadertools-everywhere-src-6.5.1/src/shadertools/../3rdparty/glslang/SPIRV/spirv.hpp:441:6: error: type ‘spv::Decoration’ violates the C++ One Definition Rule [-Werror=odr]
  441 | enum Decoration {
      |      ^
/mnt/tmp/portage/dev-qt/qtshadertools-6.5.1/work/qtshadertools-everywhere-src-6.5.1/src/3rdparty/SPIRV-Cross/spirv.hpp:445:6: note: an enum with different value name is defined in another translation unit
  445 | enum Decoration {
      |      ^
/mnt/tmp/portage/dev-qt/qtshadertools-6.5.1/work/qtshadertools-everywhere-src-6.5.1/src/shadertools/../3rdparty/glslang/SPIRV/spirv.hpp:545:5: note: name ‘DecorationBufferLocationINTEL’ differs from name ‘DecorationAliasScopeINTEL’ defined in another translation unit
  545 |     DecorationBufferLocationINTEL = 5921,
      |     ^
/mnt/tmp/portage/dev-qt/qtshadertools-6.5.1/work/qtshadertools-everywhere-src-6.5.1/src/3rdparty/SPIRV-Cross/spirv.hpp:549:5: note: mismatching definition
  549 |     DecorationAliasScopeINTEL = 5914,
      |     ^
/mnt/tmp/portage/dev-qt/qtshadertools-6.5.1/work/qtshadertools-everywhere-src-6.5.1/src/shadertools/../3rdparty/glslang/SPIRV/spirv.hpp:1185:6: error: type ‘spv::Op’ violates the C++ One Definition Rule [-Werror=odr]
 1185 | enum Op {
      |      ^
/mnt/tmp/portage/dev-qt/qtshadertools-6.5.1/work/qtshadertools-everywhere-src-6.5.1/src/3rdparty/SPIRV-Cross/spirv.hpp:1199:6: note: an enum with different value name is defined in another translation unit
 1199 | enum Op {
      |      ^
/mnt/tmp/portage/dev-qt/qtshadertools-6.5.1/work/qtshadertools-everywhere-src-6.5.1/src/shadertools/../3rdparty/glslang/SPIRV/spirv.hpp:1536:5: note: name ‘OpSubgroupReadInvocationKHR’ differs from name ‘OpGroupNonUniformRotateKHR’ defined in another translation unit
 1536 |     OpSubgroupReadInvocationKHR = 4432,
      |     ^
/mnt/tmp/portage/dev-qt/qtshadertools-6.5.1/work/qtshadertools-everywhere-src-6.5.1/src/3rdparty/SPIRV-Cross/spirv.hpp:1550:5: note: mismatching definition
 1550 |     OpGroupNonUniformRotateKHR = 4431,
      |     ^
/mnt/tmp/portage/dev-qt/qtshadertools-6.5.1/work/qtshadertools-everywhere-src-6.5.1/src/3rdparty/SPIRV-Cross/spirv.hpp:63:6: error: type ‘spv::SourceLanguage’ violates the C++ One Definition Rule [-Werror=odr]
   63 | enum SourceLanguage {
      |      ^
/mnt/tmp/portage/dev-qt/qtshadertools-6.5.1/work/qtshadertools-everywhere-src-6.5.1/src/3rdparty/glslang/SPIRV/spirv.hpp:61:6: note: an enum with different value name is defined in another translation unit
   61 | enum SourceLanguage {
      |      ^
/mnt/tmp/portage/dev-qt/qtshadertools-6.5.1/work/qtshadertools-everywhere-src-6.5.1/src/3rdparty/SPIRV-Cross/spirv.hpp:71:5: note: name ‘SourceLanguageSYCL’ differs from name ‘SourceLanguageMax’ defined in another translation unit
   71 |     SourceLanguageSYCL = 7,
      |     ^
/mnt/tmp/portage/dev-qt/qtshadertools-6.5.1/work/qtshadertools-everywhere-src-6.5.1/src/3rdparty/glslang/SPIRV/spirv.hpp:69:5: note: mismatching definition
   69 |     SourceLanguageMax = 0x7fffffff,
      |     ^
/mnt/tmp/portage/dev-qt/qtshadertools-6.5.1/work/qtshadertools-everywhere-src-6.5.1/src/3rdparty/SPIRV-Cross/spirv.hpp:870:6: error: type ‘spv::Capability’ violates the C++ One Definition Rule [-Werror=odr]
  870 | enum Capability {
      |      ^
/mnt/tmp/portage/dev-qt/qtshadertools-6.5.1/work/qtshadertools-everywhere-src-6.5.1/src/3rdparty/glslang/SPIRV/spirv.hpp:860:6: note: an enum with different value name is defined in another translation unit
  860 | enum Capability {
      |      ^
/mnt/tmp/portage/dev-qt/qtshadertools-6.5.1/work/qtshadertools-everywhere-src-6.5.1/src/3rdparty/SPIRV-Cross/spirv.hpp:1069:5: note: name ‘CapabilityMemoryAccessAliasingINTEL’ differs from name ‘CapabilityFPGABufferLocationINTEL’ defined in another translation unit
 1069 |     CapabilityMemoryAccessAliasingINTEL = 5910,
      |     ^
/mnt/tmp/portage/dev-qt/qtshadertools-6.5.1/work/qtshadertools-everywhere-src-6.5.1/src/3rdparty/glslang/SPIRV/spirv.hpp:1059:5: note: mismatching definition
 1059 |     CapabilityFPGABufferLocationINTEL = 5920,
      |     ^
/mnt/tmp/portage/dev-qt/qtshadertools-6.5.1/work/qtshadertools-everywhere-src-6.5.1/src/3rdparty/SPIRV-Cross/spirv.hpp:118:6: error: type ‘spv::ExecutionMode’ violates the C++ One Definition Rule [-Werror=odr]
  118 | enum ExecutionMode {
      |      ^
/mnt/tmp/portage/dev-qt/qtshadertools-6.5.1/work/qtshadertools-everywhere-src-6.5.1/src/3rdparty/glslang/SPIRV/spirv.hpp:115:6: note: an enum with different value name is defined in another translation unit
  115 | enum ExecutionMode {
      |      ^
/mnt/tmp/portage/dev-qt/qtshadertools-6.5.1/work/qtshadertools-everywhere-src-6.5.1/src/3rdparty/SPIRV-Cross/spirv.hpp:186:5: note: name ‘ExecutionModeNamedBarrierCountINTEL’ differs from name ‘ExecutionModeMax’ defined in another translation unit
  186 |     ExecutionModeNamedBarrierCountINTEL = 6417,
      |     ^
/mnt/tmp/portage/dev-qt/qtshadertools-6.5.1/work/qtshadertools-everywhere-src-6.5.1/src/3rdparty/glslang/SPIRV/spirv.hpp:183:5: note: mismatching definition
  183 |     ExecutionModeMax = 0x7fffffff,
      |     ^
lto1: some warnings being treated as errors
lto-wrapper: fatal error: /usr/bin/x86_64-pc-linux-gnu-g++ returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
Comment 1 Kostadin Shishmanov 2023-08-06 20:37:53 UTC
Can't reproduce on 6.5.2. I believe this commit has fixed it:
https://github.com/qt/qtshadertools/commit/11ec821d6a58e9211eb8cc8924ced5b3ec527f73