Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 950652 - sys-devel/gcc-15.0.1_pre20250302: fails to compile llvm-core/llvm-20.1.0
Summary: sys-devel/gcc-15.0.1_pre20250302: fails to compile llvm-core/llvm-20.1.0
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard: 15 fixed; 14 pending; 13 pending; 12 ...
Keywords:
Depends on:
Blocks: gcc-15
  Show dependency tree
 
Reported: 2025-03-05 14:42 UTC by NHO
Modified: 2025-04-25 20:12 UTC (History)
4 users (show)

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


Attachments
emerge --info (emerge.info,7.34 KB, text/plain)
2025-03-05 14:42 UTC, NHO
Details
compressed build log (build.log.zst,64.33 KB, application/zstd)
2025-03-05 14:43 UTC, NHO
Details
preprocessed file that errors out, compressed (LSUnit.cpp.ii.zst,211.87 KB, application/zstd)
2025-03-05 14:43 UTC, NHO
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NHO 2025-03-05 14:42:32 UTC
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
Comment 1 NHO 2025-03-05 14:42:50 UTC
Created attachment 920265 [details]
emerge --info
Comment 2 NHO 2025-03-05 14:43:08 UTC
Created attachment 920266 [details]
compressed build log
Comment 3 NHO 2025-03-05 14:43:42 UTC
Created attachment 920267 [details]
preprocessed file that errors out, compressed
Comment 4 NHO 2025-03-05 14:44:35 UTC
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>>
Comment 5 NHO 2025-03-05 14:46:31 UTC
Error repeats, in slightly different form, on llvm/lib/MCA/HardwareUnits/ResourceManager.cpp and llvm/lib/MCA/HardwareUnits/RetireControlUnit.cpp
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-03-05 14:58:17 UTC
Looking.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-03-05 15:04:11 UTC
Thanks, filed upstream as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119123.
Comment 8 Larry the Git Cow gentoo-dev 2025-03-09 22:43:19 UTC
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(+)
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-03-09 22:44:43 UTC
Workaround is to drop -g* from *FLAGS.
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-03-10 08:40:42 UTC
(note that it's a checking ICE, so you'll only see it w/ USE=debug on older gcc, or with unreleased gcc).
Comment 11 PaX Team 2025-03-17 11:58:26 UTC
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?
Comment 12 tt_1 2025-03-18 18:45:35 UTC
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.
Comment 13 PaX Team 2025-03-18 20:14:06 UTC
(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 :).
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-03-23 01:02:49 UTC
Will have a look in a few days.
Comment 15 Larry the Git Cow gentoo-dev 2025-03-30 14:29:52 UTC
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(+)