FS#74403 - [gcc] 11.2.0-4 lot1 errors when linking w/ static library, built with LTO 11.2, and requests 11.0
Attached to Project:
Arch Linux
Opened by Adel KARA SLIMANE (adelks) - Friday, 08 April 2022, 12:57 GMT
Last edited by freswa (frederik) - Wednesday, 27 April 2022, 20:42 GMT
Opened by Adel KARA SLIMANE (adelks) - Friday, 08 April 2022, 12:57 GMT
Last edited by freswa (frederik) - Wednesday, 27 April 2022, 20:42 GMT
|
Details
Description:
while linking my executable with a static library that is built with LTO (and GCC 11.2 on Ubuntu). I get this error: ``` lto1: fatal error: bytecode stream in file ‘../[...]/my_library.a’ generated with LTO version 11.2 instead of the expected 11.0 ``` Even though I am running gcc 11.2, I do not know if this error message is actually accurate or the error is happening here but the real issue is elsewhere. I thought of making a dummy static library built with my system's GCC and test, but of course it won't reproduce this issue since LTO would write it's allegedly wrong (11.0) version in it ? Of course, if this is the real issue. I could not find online how to check the LTO version of GCC that was used in any given static library. Some help would be appreciated, thanks! Adel |
This task depends upon
Closed by freswa (frederik)
Wednesday, 27 April 2022, 20:42 GMT
Reason for closing: Won't fix
Additional comments about closing: Compilation processes on Ubuntu are out of our scope.
Wednesday, 27 April 2022, 20:42 GMT
Reason for closing: Won't fix
Additional comments about closing: Compilation processes on Ubuntu are out of our scope.
Arch does not contain that patch its most recent update to the LTO constants is [3]. Which explains why gcc 11.2 from Arch has 11.0 while Ubuntu has 11.2.
As the versions changes indicate binary incompatibilities you can not link those files together with LTO enabled.
[1] https://github.com/gcc-mirror/gcc/commit/dce5367eecfb0729cad0325240d614721afb39e3
[2] https://github.com/gcc-mirror/gcc/commit/8621acaa879610c967f75a48313e2973f29c78d1
[3] https://github.com/gcc-mirror/gcc/commit/432a5b8744bc89f1975cba37cefd9f545f8abe86
[1] https://bugs.archlinux.org/task/74177#comment207301