main/protobuf-c: static library has LTO info, fails to link
Package Information
- Package name: protobuf-c-dev
- Package version: 1.4.1-r7
- Alpine version: 3.20.0_alpha20240315
- Alpine architecture: x86_64
Summary
Static library libprotobuf-c.a contins LTO info from the older compiler, fails to link with the newer compiler (gcc-13.2.1_git20240309-r0)
Steps to reproduce
$ cat proto.c
#include <stdio.h>
#include <protobuf-c/protobuf-c.h>
int
main(void)
{
printf("%s\n", protobuf_c_version());
return 0;
}
$ cc -static -o proto proto.c -lprotobuf-c
lto1: fatal error: bytecode stream in file '/usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../lib/libprotobuf-c.a' generated with LTO version 13.0 instead of the expected 13.1
compilation terminated.
lto-wrapper: fatal error: cc returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status