media-video/ffmpeg: fix LTO handling with multilib

Checking ABI and filtering based on that doesn't work in multilib_src_configure
because of contamination & the order the phases / ABIs run in.

Closes: https://bugs.gentoo.org/923491
Thanks-to: Michael Cook <mackal.cook@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2024-06-04 04:25:05 +01:00
parent 7c5dc3d215
commit d9a701f0e4
2 changed files with 20 additions and 10 deletions
+10 -5
View File
@@ -419,6 +419,14 @@ src_prepare() {
ln -snf "${FILESDIR}"/chromium.c chromium.c || die
echo 'include $(SRC_PATH)/ffbuild/libffmpeg.mak' >> Makefile || die
# We need to detect LTO usage before multilib stuff and filter-lto is called (bug #923491)
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"
fi
filter-lto
}
multilib_src_configure() {
@@ -510,12 +518,9 @@ multilib_src_configure() {
done
# LTO support, bug #566282, bug #754654, bug #772854
if [[ ${ABI} != x86 ]] && tc-is-lto; then
# Respect -flto value, e.g -flto=thin
local v="$(get-flag flto)"
[[ -n ${v} ]] && myconf+=( "--enable-lto=${v}" ) || myconf+=( "--enable-lto" )
if [[ ${ABI} != x86 && ! -z ${LTO_FLAG} ]]; then
myconf+=( ${LTO_FLAG} )
fi
filter-lto
# Mandatory configuration
myconf=(
+10 -5
View File
@@ -414,6 +414,14 @@ src_prepare() {
ln -snf "${FILESDIR}"/chromium.c chromium.c || die
echo 'include $(SRC_PATH)/ffbuild/libffmpeg.mak' >> Makefile || die
# We need to detect LTO usage before multilib stuff and filter-lto is called (bug #923491)
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"
fi
filter-lto
}
multilib_src_configure() {
@@ -505,12 +513,9 @@ multilib_src_configure() {
done
# LTO support, bug #566282, bug #754654, bug #772854
if [[ ${ABI} != x86 ]] && tc-is-lto; then
# Respect -flto value, e.g -flto=thin
local v="$(get-flag flto)"
[[ -n ${v} ]] && myconf+=( "--enable-lto=${v}" ) || myconf+=( "--enable-lto" )
if [[ ${ABI} != x86 && ! -z ${LTO_FLAG} ]]; then
myconf+=( ${LTO_FLAG} )
fi
filter-lto
# Mandatory configuration
myconf=(