Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 631352 - media-video/ffmpeg ebuilds do not respect -fno-lto
Summary: media-video/ffmpeg ebuilds do not respect -fno-lto
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
: 772887 (view as bug list)
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2017-09-18 21:07 UTC by Shane Peelar
Modified: 2022-08-01 22:31 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shane Peelar 2017-09-18 21:07:02 UTC
In https://bugs.gentoo.org/566282 , the ebuilds for media-video/ffmpeg were amended to support LTO.  Unfortunately, they do not respect the -fno-lto flag, particularly if your CFLAGS/CXXFLAGS contain "-flto -fno-lto" -- it will build with "--enable-lto" regardless.

A comment on that bug report suggested a fix: https://bugs.gentoo.org/566282#c6

I have tested this fix on my own overlay and it appears to work as intended.  I can submit patches to fix the ebuilds using this if desired.

Thank you for your time,
Shane Peelar
Comment 1 Shane Peelar 2017-09-22 12:19:43 UTC
PR created: https://github.com/gentoo/gentoo/pull/5766
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-08-01 22:30:28 UTC
commit 4e7e25bb617a8202fb1a0f0381949dcd380de614
Author: David Michael <fedora.dm0@gmail.com>
Date:   Mon Mar 22 11:06:25 2021 +0100

    media-video/ffmpeg: work around cross-endian tests failing

    Cross-compiling with LTO prevents the build system from detecting
    endianness.  Upstream says that enabling LTO with CFLAGS is not
    supported, so filter -flto* out of CFLAGS after adding --enable-lto
    to the configure command (which just adds back -flto after endian
    tests pass).

    Closes: https://bugs.gentoo.org/754654
    Package-Manager: Portage-3.0.13, Repoman-3.0.2
    Signed-off-by: David Michael <fedora.dm0@gmail.com>
    Signed-off-by: David Seifert <soap@gentoo.org>

And previous context:

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>

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>
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-08-01 22:31:26 UTC
*** Bug 772887 has been marked as a duplicate of this bug. ***