commit: 2fbd9aa700613a6070ca84af92b58e253a389e63
Author: Eli Schwartz <eschwartz93 <AT> gmail <DOT> com>
AuthorDate: Tue Jun 4 03:52:49 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jun 4 06:53:39 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2fbd9aa7
media-video/ffmpeg: fix another LTO breakage, this time with bare -flto
`get-flag` is a bit of a funny API. It offers to provide the value of a
flag, implying, the part after the =. But if there is no = then it
simply returns you the whole flag, whereas you might think it returns
empty.
ffmpeg was relying on it returning empty for the case where no value is
passed, but instead we ended up passing --enable-lto=-flto for such a
case, which the ffmpeg configure script happily accepts as a valid
value, and then silently drops since it doesn't actually work.
End result: no LTO for the package with -flto, but working LTO if you
used e.g. -flto=4 instead.
Explicitly handle the -flto case.
Signed-off-by: Eli Schwartz <eschwartz93 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
media-video/ffmpeg/ffmpeg-6.1.1-r6.ebuild | 2 +-
media-video/ffmpeg/ffmpeg-9999.ebuild | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/media-video/ffmpeg/ffmpeg-6.1.1-r6.ebuild
b/media-video/ffmpeg/ffmpeg-6.1.1-r6.ebuild
index fa3dd7774141..78278c02f240 100644
--- a/media-video/ffmpeg/ffmpeg-6.1.1-r6.ebuild
+++ b/media-video/ffmpeg/ffmpeg-6.1.1-r6.ebuild
@@ -424,7 +424,7 @@ src_prepare() {
if tc-is-lto ; then
# Respect -flto value, e.g -flto=thin
local v="$(get-flag flto)"
- [[ -n ${v} ]] && LTO_FLAG="--enable-lto=${v}" ||
LTO_FLAG="--enable-lto"
+ [[ ${v} != -flto ]] && LTO_FLAG="--enable-lto=${v}" ||
LTO_FLAG="--enable-lto"
fi
filter-lto
}
diff --git a/media-video/ffmpeg/ffmpeg-9999.ebuild
b/media-video/ffmpeg/ffmpeg-9999.ebuild
index e4783cb8348f..e6491c785ef4 100644
--- a/media-video/ffmpeg/ffmpeg-9999.ebuild
+++ b/media-video/ffmpeg/ffmpeg-9999.ebuild
@@ -419,7 +419,7 @@ src_prepare() {
if tc-is-lto ; then
# Respect -flto value, e.g -flto=thin
local v="$(get-flag flto)"
- [[ -n ${v} ]] && LTO_FLAG="--enable-lto=${v}" ||
LTO_FLAG="--enable-lto"
+ [[ ${v} != -flto ]] && LTO_FLAG="--enable-lto=${v}" ||
LTO_FLAG="--enable-lto"
fi
filter-lto
}