[FFmpeg-devel] [PATCH]Disable inline_asm_direct_symbol_refs for lto

Matt Oliver protogonoi at gmail.com
Sun May 4 06:31:31 CEST 2014


On 4 May 2014 10:48, Michael Niedermayer <michaelni at gmx.at> wrote:

> On Sat, May 03, 2014 at 09:01:55AM +0200, Carl Eugen Hoyos wrote:
> > Hi!
> >
> > Attached patch fixes compilation with --enable-lto and a recent gcc if
> h264
> > and hevc are disabled.
> > Fixes a part of ticket #2941.
> >
> > Please comment, Carl Eugen
>
> >  configure |    1 +
> >  1 file changed, 1 insertion(+)
> > 1ebcb9b8e502ad00eb2d28513e36aa092d887fe9  patchltogcc.diff
> > diff --git a/configure b/configure
> > index dd7ac79..5b34d1f 100755
> > --- a/configure
> > +++ b/configure
> > @@ -4904,6 +4904,7 @@ if enabled lto; then
> >      test "$cc_type" != "$ld_type" && die "LTO requires same compiler
> and linker"
> >      check_cflags  -flto
> >      check_ldflags -flto $cpuflags
> > +    disable inline_asm_direct_symbol_refs
> >  fi
>
> why is inline_asm_direct_symbol_refs not disabled automatically ?
> is ths inline_asm_direct_symbol_refs test run after adding the lto
> flags ?
>

 inline_asm_direct_symbol_refs is tested before lto is added as currently
lto is added very late in the sequence. The problem is that lto moves alot
of optimization work to link time so the current checks for
inline_asm_direct_symbol_refs are compilation checks which would have to be
extended to also check linking. However pretty much every other test is
also doing just a compilation test and with lto already enabled some of
these may incorrectly pass when they shouldnt as they wont fail until a
link test is done. So moving lto earlier in the configure script may brake
a significant number of existing tests.

So the other way would be to extend the inline_asm_direct_symbol_refs so
that it checks and adds the lto explicitly to just its test but the way
Carl suggested is probably cleaner.


More information about the ffmpeg-devel mailing list