https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126893

            Bug ID: 126893
           Summary: [17 regression] LTO bootstrap failure (lto1: fatal
                    error: LTO_symtab_tags out of range: Range is 0 to 6,
                    value is 44)
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: build, lto
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

LTO bootstrap fails for me at the very end, when libtool relinks during
installation (which is very unfortunate with LTO, see
https://bugs.gnu.org/72613):
```
x86_64-pc-linux-gnu-ranlib --plugin
/usr/libexec/gcc/x86_64-pc-linux-gnu/17/liblto_plugin.so
m2/gm2-libs-boot/libgm2.a
test -d m2/stage1 || /bin/sh
/var/tmp/portage.notmp/portage/sys-devel/gcc-17.0.9999/work/gcc-17.0.9999/gcc/../mkinstalldirs
m2/stage1
/usr/x86_64-pc-linux-gnu/gcc-bin/17/x86_64-pc-linux-gnu-g++
-specs=/var/tmp/portage.notmp/portage/sys-devel/gcc-17.0.9999/temp/ada.spec
-std=c++14 -pie -Wl,-z,now -DDEF_GENTOO_SCP -DDEF_GENTOO_ZNOW -DEXTRA_OPTIONS
-DGENTOO_FORTIFY_SOURCE_LEVEL=3 -DDEF_GENTOO_GLIBCXX_ASSERTIONS     -O3
-march=native -fno-semantic-interposition -ggdb3 -pipe -fcf-protection=none
-fdiagnostics-color=always -fdiagnostics-urls=never
-fdiagnostics-show-context=3 --param=ggc-min-expand=120 -Wstrict-aliasing
-Wfree-nonheap-object -Wuninitialized -Wmaybe-uninitialized -Wreturn-type
-Wbuiltin-declaration-mismatch -Wtautological-compare -Werror=lto-type-mismatch
-Werror=strict-aliasing -Werror=odr -Wstringop-overread -Wstringop-overflow
-Wstringop-truncation -Wformat-overflow Wformat-truncation -Wrestrict -ggdb3
-Wno-error=lto-type-mismatch -Wno-error=odr -DIN_GCC   -W -Wall
-Wno-error=narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes
-Wmissing-prototypes  -Wold-style-definition -Wc++-compat  -DHAVE_CONFIG_H -O3
-march=native -fno-semantic-interposition -ggdb3 -pipe -fcf-protection=none
-fdiagnostics-color=always -fdiagnostics-urls=never
-fdiagnostics-show-context=3 --param=ggc-min-expand=120
-Werror=lto-type-mismatch -Werror=strict-aliasing -Werror=odr
-Wstringop-overread -Wstringop-overflow -Wstringop-truncation -Wformat-overflow
-Wformat-truncation -Wrestrict -Wl,-O1 -Wl,--as-needed
-Wl,-z,pack-relative-relocs -Wl,--defsym=__gentoo_check_ldflags__=0 -ggdb3
-Wno-error=lto-type-mismatch -Wno-error=odr -o m2/stage1/cc1gm2 m2/gm2-lang.o
m2/gm2-gcc/m2pp.o m2/gm2-gcc/m2assert.o m2/gm2-gcc/m2block.o
m2/gm2-gcc/m2builtins.o m2/gm2-gcc/m2except.o m2/gm2-gcc/m2color.o
m2/gm2-gcc/m2configure.o m2/gm2-gcc/m2convert.o m2/gm2-gcc/m2decl.o
m2/gm2-gcc/m2expr.o m2/gm2-gcc/m2linemap.o m2/gm2-gcc/m2spellcheck.o
m2/gm2-gcc/m2statement.o m2/gm2-gcc/m2type.o m2/gm2-gcc/m2tree.o
m2/gm2-gcc/m2treelib.o m2/gm2-gcc/m2top.o m2/gm2-gcc/m2misc.o m2/gm2-gcc/init.o
m2/gm2-compiler-boot/m2flex.o \
                            attribs.o \
                             m2/gm2-compiler-boot/gm2.a
m2/gm2-libs-boot/libgm2.a  m2/mc-boot-ch/Glibc.o m2/mc-boot-ch/Gmcrts.o \
                             m2/gm2-gcc/rtegraph.o \
                             simple-diagnostic-path.o diagnostics/lazy-paths.o
libbackend.a main.o libcommon-target.a libcommon.a ../libcpp/libcpp.a
../libdecnumber/libdecnumber.a libcommon.a ../libcpp/libcpp.a
   ../libbacktrace/.libs/libbacktrace.a ../libiberty/pic/libiberty.a
../libdecnumber/libdecnumber.a  -lisl -lmpc -lmpfr -lgmp -rdynamic  -lz
-Lyes/lib -lzstd                                                    
/var/tmp/portage.notmp/portage/sys-devel/gcc-17.0.9999/work/gcc-17.0.9999/gcc/callback-info.h:28:7:
warning: type ‘struct callback_info’ violates the C++ One Definition Rule
[-Wodr]                                28 | class callback_info
      |       ^                                                                
                                                                               
                                                 
/var/tmp/portage.notmp/portage/sys-devel/gcc-17.0.9999/work/gcc-17.0.9999/gcc/plugin.cc:104:8:
note: a different type is defined in another translation unit                  
                                     104 | struct callback_info
      |        ^
/var/tmp/portage.notmp/portage/sys-devel/gcc-17.0.9999/work/gcc-17.0.9999/gcc/callback-info.h:36:12:
note: the first difference of corresponding definitions is field ‘fn_idx’      
                                36 |   unsigned fn_idx;                        
                                                                               
                                                                               
     |            ^
/var/tmp/portage.notmp/portage/sys-devel/gcc-17.0.9999/work/gcc-17.0.9999/gcc/plugin.cc:106:15:
note: a field with different name is defined in another translation unit       
                                    106 |   const char *plugin_name;   /* Name
of plugin that registers the callback.  */
      |               ^                                                        
                                                                               
                                                  lto1: fatal error:
LTO_symtab_tags out of range: Range is 0 to 6, value is 44
compilation terminated.                                                        
                                                                               
                                                  lto-wrapper: fatal error:
/usr/x86_64-pc-linux-gnu/gcc-bin/17/x86_64-pc-linux-gnu-g++ returned 1 exit
status                                                                         
                            compilation terminated.
/usr/x86_64-pc-linux-gnu/binutils-bin/9999/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[2]: ***
[/var/tmp/portage.notmp/portage/sys-devel/gcc-17.0.9999/work/gcc-17.0.9999/gcc/m2/Make-lang.in:547:
m2/stage1/cc1gm2] Error 1
make[2]: Leaving directory
'/var/tmp/portage.notmp/portage/sys-devel/gcc-17.0.9999/work/build/gcc'
make[1]: *** [Makefile:5213: install-gcc] Error 2
make[1]: Leaving directory
'/var/tmp/portage.notmp/portage/sys-devel/gcc-17.0.9999/work/build'
make: *** [Makefile:2787: install] Error 2
 * ERROR: sys-devel/gcc-17.0.9999::gentoo failed (install phase):
```

```
/var/tmp/portage.notmp/portage/sys-devel/gcc-17.0.9999/work/build/gcc # ./xgcc
-v
Using built-in specs.
COLLECT_GCC=./xgcc
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage.notmp/portage/sys-devel/gcc-17.0.9999/work/gcc-17.0.9999/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/17
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/17/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/17
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/17/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/17/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/17/include/g++-v17
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/17/python
--enable-libphobos --enable-objc-gc
--enable-languages=c,c++,d,objc,obj-c++,fortran,ada,algol68,m2,jit
--enable-obsolete --enable-secureplt --disable-werror --with-system-zlib
--enable-nls --without-included-gettext --disable-libunwind-exceptions
--enable-checking=yes,extra,rtl --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo Hardened 17.0.9999 p, commit
4513aa16bf6c01f1e85288cb1060bec524d29127' --with-gcc-major-version-only
--enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch
--enable-linker-build-id --enable-libada --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --with-tls=gnu2 --enable-multilib
--with-multilib-list=m32,mx32,m64 --disable-fixed-point --with-abi=m64
--enable-targets=all --enable-offload-defaulted
--enable-offload-targets=nvptx-none --enable-libgomp --disable-libssp
--disable-cet --enable-systemtap --enable-valgrind-annotations
--enable-valgrind-interop --disable-vtable-verify --disable-libvtv --with-zstd
--with-isl --disable-isl-version-check --enable-default-pie --enable-host-pie
--enable-host-bind-now --enable-default-ssp --disable-fixincludes
--with-gxx-libcxx-include-dir=/usr/include/c++/v1 --enable-host-shared
--enable-libgdiagnostics --with-build-config='bootstrap-O3 bootstrap-lto'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 17.0.0 20260815 (experimental)
df494ca28d75f80b4d0b4e0b93b5d23d2092131a (Gentoo Hardened 17.0.9999 p, commit
4513aa16bf6c01f1e85288cb1060bec524d29127)
```

I last built r17-3209-g2d3a1b441aad04 fine. I will debug it more tomorrow or
early in the week.

Reply via email to