FS#67686 - [gcc] 10.2.0: lto1: internal compiler error: bytecode stream: expected tag identifier_node inste

Attached to Project: Arch Linux
Opened by leuko (leuko) - Sunday, 23 August 2020, 11:53 GMT
Last edited by freswa (frederik) - Friday, 11 February 2022, 18:23 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Jan Alexander Steffens (heftig)
Bartłomiej Piotrowski (Barthalion)
freswa (frederik)
Architecture x86_64
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 6
Private No

Details

Description:

I am on Archlinux with gcc 10.2. During compilation of python-cx_freeze (master), I get the following error:

```
git clone https://github.com/marcelotduarte/cx_Freeze
cd cx_Freeze
python setup.py build
...
creating build/lib.linux-x86_64-3.8/cx_Freeze/bases
gcc -pthread build/temp.linux-x86_64-3.8/source/bases/Console.o -L/usr/lib/python3.8/config-3.8-x86_64-linux-gnu -L/usr/lib -lpython3.8 -o build/lib.linux-x86_64-3.8/cx_Freeze/bases/Console -Xlinker -export-dynamic -lcrypt -lpthread -ldl -lutil -lm -lm -s
lto1: internal compiler error: bytecode stream: expected tag identifier_node instead of LTO_UNKNOWN
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.archlinux.org/> for instructions.
lto-wrapper: fatal error: gcc returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
```

Falling back to gcc 10.1 is a workaround.

[Johannes Hirte reports a similar behavior when compiling qemu on Gentoo](https://bugs.gentoo.org/733886), and fixed it by recompiling glib. I thought this could be a Archlinux packaging related issue.

Additional info:

```
gcc -v

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-werror gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (GCC)
```
This task depends upon

Closed by  freswa (frederik)
Friday, 11 February 2022, 18:23 GMT
Reason for closing:  Not a bug
Additional comments about closing:  Not a bug anymore
Comment by leuko (leuko) - Sunday, 23 August 2020, 11:57 GMT
attached full build log
Comment by Alexander Mezin (Sanya_M) - Monday, 24 August 2020, 03:34 GMT
Same error when trying to rebuild mutter package. Rebuilding and installing glib2 doesn't help.
Comment by Alexander Mezin (Sanya_M) - Monday, 24 August 2020, 03:52 GMT
So this issue is caused by old (built with previous gcc version) static libraries.
In my case, mutter was linking against /usr/lib/libsysprof-capture-3.a. I've rebuilt and reinstalled sysprof, and the problem is now gone.
You need to rebuild the python interpreter, I guess.
Any package that contains a static library probably has to be rebuilt.
Comment by solsTiCe (zebul666) - Thursday, 27 August 2020, 13:12 GMT
Same error when trying to build qemu-user-static fom AUR. I had to rebuild glib2-static. Thank you gcc...
Comment by Felix Yan (felixonmars) - Saturday, 05 September 2020, 12:14 GMT
Python has been rebuilt as 3.8.5-2. Please try again.
Comment by leuko (leuko) - Sunday, 06 September 2020, 07:01 GMT
Thank you Felix, the new package resolves the error.
Comment by George (Vash63) - Sunday, 06 September 2020, 16:29 GMT
  • Field changed: Percent Complete (100% → 0%)
This bug was filed against GCC, it was only fixed for Python but not other packages broken in the GCC update (glib2-static and sysprof both mentioned in comments. I can duplicate it personally with sysprof).
Comment by Doug Newgard (Scimmia) - Sunday, 06 September 2020, 16:30 GMT
glib2-static is in the AUR, that's the user's responsibility, but any static libs in the repos that use lto need rebuilt. This should really have a list somewhere, maybe a todo list.
Comment by Bruno Beltran (brunobeltran) - Tuesday, 29 September 2020, 20:54 GMT
Building `matplotlib` locally now fails with this same error. I made sure to reinstall all my AUR packages, but it still doesn't work. Does anybody have any pointers as to how to figure out which library is causing the link to fail? I'm happy to recompile anything that I need to but not sure how to start debugging this...
Comment by Bruno Beltran (brunobeltran) - Wednesday, 30 September 2020, 19:07 GMT
Update: turns out matplotlib builds its own version of freetype into a hidden folder in the build directory, so all I had to do was delete the "build" directory completely to trigger it to rebuild.

Loading...