Build failure with /var/tmp/portage/llvm-core/llvm-20.1.0/work/llvm/include/llvm/MCA/HardwareUnits/RetireControlUnit.h:36:8: error: type variant has different ‘TYPE_FIELDS’ and two other repeats. Full error is too big for this field, see attachments Reproducible: Always
Created attachment 920265 [details] emerge --info
Created attachment 920266 [details] compressed build log
Created attachment 920267 [details] preprocessed file that errors out, compressed
FAILED: lib/MCA/CMakeFiles/LLVMMCA.dir/HardwareUnits/LSUnit.cpp.o /usr/bin/x86_64-pc-linux-gnu-g++ -DLLVM_EXPORTS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/var/tmp/portage/llvm-core/llvm-20.1.0/work/llvm_build-abi_x86_64.amd64/lib/MCA -I/var/tmp/portage/ll vm-core/llvm-20.1.0/work/llvm/lib/MCA -I/var/tmp/portage/llvm-core/llvm-20.1.0/work/llvm_build-abi_x86_64.amd64/include -I/var/tmp/portage/llvm-core/llvm-20.1.0/work/llvm/include -DNDEBUG -march=native -O2 -pipe -ggdb -fno-semantic-in terposition -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsugges t-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -std=c++17 -MD -MT lib/MCA/CMakeFiles/LLVMMCA.dir/HardwareUnits/LSUnit.cpp.o -MF lib/MCA/CMakeFiles/LL VMMCA.dir/HardwareUnits/LSUnit.cpp.o.d -o lib/MCA/CMakeFiles/LLVMMCA.dir/HardwareUnits/LSUnit.cpp.o -c /var/tmp/portage/llvm-core/llvm-20.1.0/work/llvm/lib/MCA/HardwareUnits/LSUnit.cpp /var/tmp/portage/llvm-core/llvm-20.1.0/work/llvm/lib/MCA/HardwareUnits/LSUnit.cpp:44:6: error: type variant has different ‘TYPE_FIELDS’ 44 | void LSUnit::cycleEvent() { | ^~~~~~ <record_type 0x7f94b7216540 MCSchedModel asm_written cxx-odr-p type_5 type_6 BLK size <integer_cst 0x7f94ba3c48a0 type <integer_type 0x7f94bca290a8 bitsizetype> constant 576> unit-size <integer_cst 0x7f94ba3c4900 type <integer_type 0x7f94bca29000 sizetype> constant 72> align:64 warn_if_not_align:0 symtab:-1222511120 alias-set -1 canonical-type 0x7f94b7216540 fields <template_decl 0x7f94b721d3b8 ._anon_115 type <record_type 0x7f94b72341f8 ._anon_115 cxx-odr-p type_0 type_5 type_6 VOID size <integer_cst 0x7f94bca202e8 constant 0> unit-size <integer_cst 0x7f94bca202a0 constant 0> align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x7f94b72341f8 fields <using_decl 0x7f94b7223b40 operator=> context <record_type 0x7f94b7216540 MCSchedModel> template-info <template_info 0x7f94b753f348 template <template_decl 0x7f94b721d3b8 ._anon_115> args <tree_vec 0x7f94b75cc620 length:4 elt:0 <template_type_parm 0x7f94b7228000 MCSubtargetInfo> elt:1 <template_type_parm 0x7f94b72280a8 MCInstrInfo> elt:2 <template_type_parm 0x7f94b7228150 InstrItineraryData> elt:3 < template_type_parm 0x7f94b72281f8 MCInstOrMachineInstr>>> full-name "struct llvm::MCSchedModel::<lambda(const struct llvm::MCSchedClassDesc*)>" n_parents=0 use_template=0 interface-unknown chain <type_decl 0x7f94b7223960 ._anon_115>>
Error repeats, in slightly different form, on llvm/lib/MCA/HardwareUnits/ResourceManager.cpp and llvm/lib/MCA/HardwareUnits/RetireControlUnit.cpp
Looking.
Thanks, filed upstream as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119123.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=648370cbe402edecd4e696348bf35c6fa056e4b5 commit 648370cbe402edecd4e696348bf35c6fa056e4b5 Author: Sam James <sam@gentoo.org> AuthorDate: 2025-03-09 22:42:49 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-03-09 22:42:58 +0000 sys-devel/gcc: add 15.0.1_pre20250309 Bug: https://bugs.gentoo.org/950463 Bug: https://bugs.gentoo.org/950652 Closes: https://bugs.gentoo.org/949343 Signed-off-by: Sam James <sam@gentoo.org> sys-devel/gcc/Manifest | 1 + sys-devel/gcc/gcc-15.0.1_pre20250309.ebuild | 52 +++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+)
Workaround is to drop -g* from *FLAGS.
(note that it's a checking ICE, so you'll only see it w/ USE=debug on older gcc, or with unreleased gcc).
gcc 14 and gcc 13 are also affected (and presumably more based on the gcc bugzilla comments), can you backport the fix there too please?
I *think* you can pull the fix from the master branch and add it via /etc/portage/patches to gcc-14 without any manual backporting.
(In reply to tt_1 from comment #12) > I *think* you can pull the fix from the master branch and add it via > /etc/portage/patches to gcc-14 without any manual backporting. sure that works, that's what I did but it doesn't scale for all gentoo users too well :).
Will have a look in a few days.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d0d52ab4b673f784eb66572ff2f0e062fe65937 commit 3d0d52ab4b673f784eb66572ff2f0e062fe65937 Author: Sam James <sam@gentoo.org> AuthorDate: 2025-03-30 14:29:14 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-03-30 14:29:14 +0000 sys-devel/gcc: add 14.2.1_p20250329 Bug: https://bugs.gentoo.org/950652 Signed-off-by: Sam James <sam@gentoo.org> sys-devel/gcc/Manifest | 1 + sys-devel/gcc/gcc-14.2.1_p20250329.ebuild | 54 +++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+)