https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111925
Bug ID: 111925 Summary: fail to build qemu when compile with lto Product: gcc Version: 10.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: yancheng.li at foxmail dot com Target Milestone: --- This is happening when attempting to build qemu-6.2.0 with configuration --enable-lto: $ ./configure --prefix=/usr '--target-list=aarch64-softmmu x86_64-softmmu arm-softmmu riscv32-softmmu riscv64-softmmu' '--extra-cflags=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/generic-hardened-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fPIE -DPIE -fPIC -ftls-model=initial-exec' '--extra-ldflags=-Wl,--build-id -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack' --datadir=/usr/share --docdir=/usr/share/doc/ --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sysconfdir=/etc --interp-prefix=/usr/qemu-%M --firmwarepath=/usr/share/qemu --with-pkgversion=qemu-6.2.0-80.oe1 --python=/usr/bin/python3 --enable-slirp=system --enable-slirp-smbd --enable-gtk --enable-docs --enable-guest-agent --enable-pie --enable-numa --enable-mpath --disable-libnfs --disable-bzip2 --enable-kvm --enable-tcg --enable-rdma --enable-linux-aio --enable-linux-io-uring --enable-cap-ng --enable-vhost-user --enable-vhost-net --enable-vhost-kernel --enable-vhost-user-blk-server --enable-vhost-vdpa --enable-vhost-vsock --enable-tpm --enable-modules --enable-libssh --enable-fdt --enable-virglrenderer --enable-cap-ng --enable-libusb --enable-rbd --disable-dmg --disable-qcow1 --disable-vdi --disable-vvfat --disable-qed --disable-parallels --disable-capstone --disable-smartcard --enable-zstd --disable-brlapi --disable-plugins --enable-debug --enable-lto ... [181/2222] Linking target fsdev/virtfs-proxy-helper FAILED: fsdev/virtfs-proxy-helper cc -o fsdev/virtfs-proxy-helper fsdev/virtfs-proxy-helper.p/virtfs-proxy-helper.c.o fsdev/virtfs-proxy-helper.p/9p-marshal.c.o fsdev/virtfs-proxy-helper.p/9p-iov-marshal.c.o -Wl,--as-needed -Wl,--no-undefined -pie -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -fstack-protector-strong -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/generic-hardened-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -fPIE -DPIE -fPIC -ftls-model=initial-exec -flto=96 -Wl,--build-id -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -flto=96 -Wl,--start-group libqemuutil.a subprojects/libvhost-user/libvhost-user-glib.a subprojects/libvhost-user/libvhost-user.a -lcap-ng /usr/lib64/liburing.so -lutil -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -Wl,--export-dynamic -pthread -lgmodule-2.0 -lglib-2.0 -lglib-2.0 /usr/lib64/libgnutls.so -lm /usr/lib64/libpixman-1.so -lgmodule-2.0 -lglib-2.0 -lglib-2.0 -Wl,--end-group /usr/bin/ld: /tmp/virtfs-proxy-helper.wCXTDh.ltrans0.ltrans.o: in function `open_regular': /home/lyc/rpmbuild/BUILD/qemu-6.2.0/hw/9pfs/9p-util.h:53: undefined reference to `error_report_once_cond' What happened to LTO?