libunwind-dev has wrong LTO data

Bug #1997161 reported by Vladimir Dergachev
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libunwind (Debian)
New
Unknown
libunwind (Ubuntu)
Confirmed
Undecided
Unassigned
Jammy
New
Undecided
Unassigned
llvm-toolchain-14 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

When linking libunwind into my program I get the following message:

lto1: fatal error: bytecode stream in file '/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/libunwind-x86_64.a' generated with LTO version 11.2 instead of the expected 11.3

LTO stands for link time optimization.

My guess is that libunwind-x86_64.a in Ubuntu repositories was compiled with earlier gcc 11.2, but the gcc version on this new installation of 22.04 is 11.3.

I am not certain whether the right fix is to recompile with newer compiler version, or to make the library without turning on link time optimization options. libunwind is used for debugging, so there is no obvious benefit in enabling link time optimization for this library.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in llvm-toolchain-14 (Ubuntu):
status: New → Confirmed
Revision history for this message
Ghislain Bourgeois (ghibourg) wrote :

I get the exact same error when building a rock on 22.04. The build is using g++.

:: lto1: fatal error: bytecode stream in file ‘/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/libunwind.a’ generated with LTO version 11.2 instead of the expected 11.3
:: compilation terminated.
:: lto-wrapper: fatal error: g++ returned 1 exit status

Changed in llvm-toolchain-14 (Ubuntu):
status: Confirmed → New
Changed in libunwind (Ubuntu):
status: New → Confirmed
Revision history for this message
Matthias Klose (doko) wrote :

The real issue is, that the .a files in the libunwind-dev package are not stripped, and therefore the LTO information is kept in these files. This is done by intent in the packaging. Trying to figure why ...

In the meantime the least invasive thing to do is to just rebuild with GCC 11.4.

no longer affects: llvm-toolchain-14 (Ubuntu Jammy)
Changed in llvm-toolchain-14 (Ubuntu):
status: New → Invalid
Revision history for this message
Vladimir Dergachev (volodya-k) wrote :

The purpose of libunwind is to allow a program to lookup symbols by addresses, for example to print a stack trace if some exception happens. For that to work the program must not be stripped either. Does a version recompiled with gcc 11.4 still works with other gcc versions one can install on Ubuntu ?

Changed in libunwind (Debian):
status: Unknown → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.