Rebuild packages against gcc >= 13 to circumvent issues with LTO
Package Information
- Package name: gmp
- Package version:
gmp-6.3.0-r0
- Alpine version:
edge
(3.19_alpha20230901
) - Alpine architecture:
x86_64
(also an issue on other architectures, e.g.,riscv64
)
Summary
Packages containing static libs (.a
files) built with gcc < 13
will cause issues during builds of other packages that use them if they build with gcc >= 13
which is the current default in alpine:edge
Steps to reproduce
I don't have a simple MWE available right now but the issue should be clear. Compiling anything that links against libgmp.a
(e.g. pihole-FTL
) results into something like:
lto1: fatal error: bytecode stream in file '/usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../lib/libgmp.a' generated with LTO version 13.0 instead of the expected 13.1
compilation terminated.
lto-wrapper: fatal error: /usr/bin/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
See similar bug reports 1 and 2 submitted to ArchLinux if additional proof is required.