commit: 188057c10cac5caf1cdb5863b060f1bbf8bfc6dd Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org> AuthorDate: Mon Oct 6 23:37:21 2025 +0000 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org> CommitDate: Tue Oct 7 00:11:46 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=188057c1
media-video/ffmpeg: disable lto if clang+mold for now gcc+any or clang+lld/bfd are fine, per bug #947697 comment #7 where rust faces a similar issue, seems to be specific to clang+mold. Do not know what is really to blame here (clang, mold, or ffmpeg's build system for not passing -flto during linking), but would rather do the simplest solution until resolved in whichever. A alternative would be to avoid stripping LDFLAGS if mold but I'd rather to leave lto handling entirely to ffmpeg to be as intended. Feel free to report if this been fixed somewhere (odds are I won't test this myself often), then will drop this after fixed toolchain was at least stabilized or added a ffmpeg backport. Put the logic on its own line for easier removal even if it does the get-flag bit for nothing. Haven't tested if older ffmpeg versions are affected too, but would rather keep this in sync so putting it in every versions (except ffmpeg-4 which hard disables lto anyway). Did test ffmpeg-8 and it did fail with it. Closes: https://bugs.gentoo.org/963835 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org> media-video/ffmpeg/ffmpeg-6.1.3.ebuild | 2 ++ media-video/ffmpeg/ffmpeg-7.1.1-r2.ebuild | 2 ++ media-video/ffmpeg/ffmpeg-7.1.2.ebuild | 2 ++ media-video/ffmpeg/ffmpeg-8.0.ebuild | 2 ++ media-video/ffmpeg/ffmpeg-9999.ebuild | 2 ++ 5 files changed, 10 insertions(+) diff --git a/media-video/ffmpeg/ffmpeg-6.1.3.ebuild b/media-video/ffmpeg/ffmpeg-6.1.3.ebuild index 016041c3dd2c..1340bff431e3 100644 --- a/media-video/ffmpeg/ffmpeg-6.1.3.ebuild +++ b/media-video/ffmpeg/ffmpeg-6.1.3.ebuild @@ -387,6 +387,8 @@ src_prepare() { if tc-is-lto; then : "$(get-flag -flto)" # get -flto=<val> (e.g. =thin) FFMPEG_ENABLE_LTO=--enable-lto${_#-flto} + + tc-ld-is-mold && tc-is-clang && FFMPEG_ENABLE_LTO= #963835 fi filter-lto diff --git a/media-video/ffmpeg/ffmpeg-7.1.1-r2.ebuild b/media-video/ffmpeg/ffmpeg-7.1.1-r2.ebuild index 703962f85e5d..3b92cea2ed5f 100644 --- a/media-video/ffmpeg/ffmpeg-7.1.1-r2.ebuild +++ b/media-video/ffmpeg/ffmpeg-7.1.1-r2.ebuild @@ -398,6 +398,8 @@ src_prepare() { if tc-is-lto; then : "$(get-flag -flto)" # get -flto=<val> (e.g. =thin) FFMPEG_ENABLE_LTO=--enable-lto${_#-flto} + + tc-ld-is-mold && tc-is-clang && FFMPEG_ENABLE_LTO= #963835 fi filter-lto } diff --git a/media-video/ffmpeg/ffmpeg-7.1.2.ebuild b/media-video/ffmpeg/ffmpeg-7.1.2.ebuild index 4ec897ff7872..d73f933f76ff 100644 --- a/media-video/ffmpeg/ffmpeg-7.1.2.ebuild +++ b/media-video/ffmpeg/ffmpeg-7.1.2.ebuild @@ -398,6 +398,8 @@ src_prepare() { if tc-is-lto; then : "$(get-flag -flto)" # get -flto=<val> (e.g. =thin) FFMPEG_ENABLE_LTO=--enable-lto${_#-flto} + + tc-ld-is-mold && tc-is-clang && FFMPEG_ENABLE_LTO= #963835 fi filter-lto } diff --git a/media-video/ffmpeg/ffmpeg-8.0.ebuild b/media-video/ffmpeg/ffmpeg-8.0.ebuild index cc2b6f54dc6e..a5c0b49bdebd 100644 --- a/media-video/ffmpeg/ffmpeg-8.0.ebuild +++ b/media-video/ffmpeg/ffmpeg-8.0.ebuild @@ -393,6 +393,8 @@ src_prepare() { if tc-is-lto; then : "$(get-flag -flto)" # get -flto=<val> (e.g. =thin) FFMPEG_ENABLE_LTO=--enable-lto${_#-flto} + + tc-ld-is-mold && tc-is-clang && FFMPEG_ENABLE_LTO= #963835 fi filter-lto } diff --git a/media-video/ffmpeg/ffmpeg-9999.ebuild b/media-video/ffmpeg/ffmpeg-9999.ebuild index 3daedc2600df..178d8023f4c2 100644 --- a/media-video/ffmpeg/ffmpeg-9999.ebuild +++ b/media-video/ffmpeg/ffmpeg-9999.ebuild @@ -392,6 +392,8 @@ src_prepare() { if tc-is-lto; then : "$(get-flag -flto)" # get -flto=<val> (e.g. =thin) FFMPEG_ENABLE_LTO=--enable-lto${_#-flto} + + tc-ld-is-mold && tc-is-clang && FFMPEG_ENABLE_LTO= #963835 fi filter-lto }
