Summary: | media-video/ffmpeg fails to build with LTO - "--enable-lto" configure option is missing | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | . <dev.rindeal+gentoo> |
Component: | Current packages | Assignee: | Gentoo Media-video project <media-video> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bjoern |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=631352 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 618550 |
Description
.
2015-11-20 02:19:31 UTC
Also, all my LTO builds have "--enable-flto" in "EXTRA_ECONF", but unfortunately ffmpeg ebuilds do not use econf. commit caed356beda25dacd829f7988c2b8b1011583111 Author: Alexis Ballier <aballier@gentoo.org> Date: Tue Jan 5 09:26:56 2016 +0100 media-video/ffmpeg: Pass --enable-lto to configure if -flto is in *FLAGS. Fixes build with lto. https://bugs.gentoo.org/show_bug.cgi?id=566282 Package-Manager: portage-2.2.26 Signed-off-by: Alexis Ballier <aballier@gentoo.org> thx! The fix does not apply when -flto is set to a value for concurrency: The is-flagq function in eclass/flag-o-matic.eclass checks for equality: + [[ -flto=5 == -flto ]] So in my case --enable-lto will not be added to $myconf. Actually, my local overlay contains this: ``` if is-flagq '-flto*'; then myconf+=( --enable-lto ) fi ``` ***notice the star*** commit 326cefdf8855ccef084426e4581ebae1af4989e2 Author: Alexis Ballier <aballier@gentoo.org> Date: Thu Jan 7 08:32:47 2016 +0100 media-video/ffmpeg: check -flto* for enabling lto, instead of only flto. Bug #566282 by rindeal & Steffen Hau. Package-Manager: portage-2.2.26 Signed-off-by: Alexis Ballier <aballier@gentoo.org> thx :) sorry for such late idea, but what if someone had `-flto -fno-lto` in their *FLAGS? GCC prefers -fno-* flags. So (hopefully) the final check should be: ``` if ! is-flagq '-fno-lto' && is-flagq '-flto*'; then myconf+=( --enable-lto ) fi ``` Can this be changed to the solution that Jan Chren proposed? For me ffmpeg does not compile even with --enable-flto but I still want to have -flto set as the default. So I have a package environment that adds "-fno-lto" only for ffmpeg and end up with exactly the "-flto -fno-lto" case that Jan Chren described. Something strange is going on with my ebuild tool. For 4.2.1, ./ffbuild/pkgconfig_generate.sh is expecting to source Sorry! Didn't mean to send that. LTO is still failing in 4.2.1 because ./ffbuild/config.sh has libdir=${something}/lib and ./ffbuild/pkgconfig_generate.sh is sourcing that (so setting --libdir isn't helping). The linking stage will fail because ffmpeg will try linking x86_64 libs with x86, correct me if I'm wrong. For some reason, config.sh and other files aren't populating at any ebuild stage so I'm at a loss on continuing. |