InBetweenNames / gentooLTO

A Gentoo Portage configuration for building with -O3, Graphite, and LTO optimizations
GNU General Public License v2.0
571 stars 96 forks source link

App-emulation/qemu fails to compile, emake failed #655

Open Eldatur opened 3 years ago

Eldatur commented 3 years ago

Every time I try to compile qemu with lto it fails, when I compile without lto it builds with no problems. Anyone have similar problems?

I'd love to use lto but I really need qemu for my setup at home.

jbcjorge commented 3 years ago

What is the message the compiler gives? I haven't got qemu installed, but it compiles without a problem. What compiler are you using?

# eix -I qemu
[I] app-emulation/qemu
     Available versions:  5.1.0-r2^t ~5.1.0-r3^t **9999*l^t {accessibility +aio alsa bzip2 +caps capstone +curl debug doc +fdt +filecaps glusterfs gnutls gtk infiniband io-uring iscsi jack jemalloc +jpeg lzo multipath ncurses nfs nls numa opengl +oss +pin-upstream-blobs plugins +png pulseaudio python rbd sasl sdl sdl-image +seccomp selinux +slirp smartcard snappy spice ssh static static-user systemtap test usb usbredir vde +vhost-net vhost-user-fs virgl virtfs +vnc vte xattr xen xfs +xkb zstd KERNEL="FreeBSD linux" PYTHON_TARGETS="python3_6 python3_7 python3_8 python3_9" QEMU_SOFTMMU_TARGETS="aarch64 alpha arm avr cris hppa i386 lm32 m68k microblaze microblazeel mips mips64 mips64el mipsel moxie nios2 or1k ppc ppc64 riscv32 riscv64 rx s390x sh4 sh4eb sparc sparc64 tricore unicore32 x86_64 xtensa xtensaeb" QEMU_USER_TARGETS="aarch64 aarch64_be alpha arm armeb cris hppa i386 m68k microblaze microblazeel mips mips64 mips64el mipsel mipsn32 mipsn32el nios2 or1k ppc ppc64 ppc64abi32 ppc64le riscv32 riscv64 s390x sh4 sh4eb sparc sparc32plus sparc64 tilegx x86_64 xtensa xtensaeb"}
     Installed versions:  5.1.0-r2^t(17:07:36 01/12/20)(aio alsa bzip2 caps curl fdt filecaps gtk jpeg ncurses nls opengl oss pin-upstream-blobs png pulseaudio sdl seccomp slirp usb vhost-net vnc xattr xkb -accessibility -capstone -debug -doc -glusterfs -gnutls -infiniband -io-uring -iscsi -jack -jemalloc -lzo -multipath -nfs -numa -plugins -python -rbd -sasl -sdl-image -selinux -smartcard -snappy -spice -ssh -static -static-user -systemtap -test -usbredir -vde -vhost-user-fs -virgl -virtfs -vte -xen -xfs -zstd KERNEL="linux -FreeBSD" PYTHON_TARGETS="python3_8 -python3_6 -python3_7 -python3_9" QEMU_SOFTMMU_TARGETS="x86_64 -aarch64 -alpha -arm -avr -cris -hppa -i386 -lm32 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -moxie -nios2 -or1k -ppc -ppc64 -riscv32 -riscv64 -rx -s390x -sh4 -sh4eb -sparc -sparc64 -tricore -unicore32 -xtensa -xtensaeb" QEMU_USER_TARGETS="aarch64 x86_64 -aarch64_be -alpha -arm -armeb -cris -hppa -i386 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -mipsn32 -mipsn32el -nios2 -or1k -ppc -ppc64 -ppc64abi32 -ppc64le -riscv32 -riscv64 -s390x -sh4 -sh4eb -sparc -sparc32plus -sparc64 -tilegx -xtensa -xtensaeb")
     Homepage:            http://www.qemu.org http://www.linux-kvm.org
     Description:         QEMU + Kernel-based Virtual Machine userland tools
jiblime commented 3 years ago

It may be possible when 5.2.0 is released. I was able to emerge qemu-9999 with LTO, currently v5.2.0-rc4. Using grep on the source directory, I suppose it has to do with switching to using meson, there isn't much mention of LTO.

app-emulation/qemu-9999::gentoo was built with the following:
USE="aio alsa bzip2 caps curl debug doc fdt filecaps gnutls gtk jpeg lzo ncurses nfs opengl oss pin-upstream-blobs plugins png pulseaudio python sasl sdl sdl-image seccomp slirp snappy spice ssh usb usbredir vde vhost-net vhost-user-fs virgl virtfs vnc vte xattr xfs xkb zstd -accessibility -capstone -glusterfs -infiniband -io-uring -iscsi -jack -jemalloc -multipath -nls -numa -rbd (-selinux) -smartcard -static -static-user -systemtap -test -xen" ABI_X86="(64)" PYTHON_TARGETS="python3_7 python3_8 -python3_6 -python3_9" QEMU_SOFTMMU_TARGETS="x86_64 -aarch64 -alpha -arm -avr -cris -hppa -i386 -lm32 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -moxie -nios2 -or1k -ppc -ppc64 -riscv32 -riscv64 -rx -s390x -sh4 -sh4eb -sparc -sparc64 -tricore -unicore32 -xtensa -xtensaeb" QEMU_USER_TARGETS="x86_64 -aarch64 -aarch64_be -alpha -arm -armeb -cris -hppa -i386 -m68k -microblaze -microblazeel -mips -mips64 -mips64el -mipsel -mipsn32 -mipsn32el -nios2 -or1k -ppc -ppc64 -ppc64abi32 -ppc64le -riscv32 -riscv64 -s390x -sh4 -sh4eb -sparc -sparc32plus -sparc64 -tilegx -xtensa -xtensaeb"
CFLAGS="-O3 -march=native -fgraphite-identity -floop-nest-optimize -fipa-pta -fdevirtualize-at-ltrans -fno-semantic-interposition -flto -flto-compression-level=9 -fno-plt -malign-data=cacheline -falign-functions=32 -flimit-function-alignment -pipe -Wl,-O1 -Wl,--as-needed"
CXXFLAGS="-O3 -march=native -fgraphite-identity -floop-nest-optimize -fipa-pta -fdevirtualize-at-ltrans -fno-semantic-interposition -flto -flto-compression-level=9 -fno-plt -malign-data=cacheline -falign-functions=32 -flimit-function-alignment -pipe -Wl,-O1 -Wl,--as-needed"
FEATURES="unmerge-logs userfetch unmerge-orphans distlocks fixlafiles parallel-install assume-digests parallel-fetch sign news binpkg-multi-instance unknown-features-warn binpkg-docompress sandbox pid-sandbox split-log ipc-sandbox test-fail-continue noclean downgrade-backup xattr preserve-libs sfperms strict usersandbox multilib-strict protect-owned config-protect-if-modified userpriv candy merge-sync usersync qa-unresolved-soname-deps"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -O3 -march=native -fgraphite-identity -floop-nest-optimize -fipa-pta -fdevirtualize-at-ltrans -fno-semantic-interposition -flto -flto-compression-level=9 -fno-plt -malign-data=cacheline -falign-functions=32 -flimit-function-alignment -pipe"

Since it's a live ebuild and qemu has changed, I had to use FEATURES=-network-sandbox and touch /var/tmp/portage/app-emulation/qemu-9999/work/qemu-9999/{README,Changelog,AUTHORS,NEWS,TODO,CHANGES,THANKS,BUGS,FAQ,CREDITS,CHANGELOG}

The build system tried to update the submodules midway through. The translation files in po/ were also deleted and caused installing to fail, I copied it from the git but that could be touched too. Really you'd just need to edit the ebuild a tiny bit and it might be okay. I tested a vm with pc-q35-5.2 and nothing bad has happened yet.

qemu-v5.2.0-rc4-test.log