[FFmpeg-devel] Patch: icl linker errors in cmdutils

Matt Oliver protogonoi at gmail.com
Fri Feb 7 14:25:15 CET 2014


On 7 February 2014 23:21, Michael Niedermayer <michaelni at gmx.at> wrote:

> On Fri, Feb 07, 2014 at 11:56:04AM +1100, Matt Oliver wrote:
> > Currently there is a linker error in cmdutils.c as used by ffmpeg and the
> > other programs. This error is due to missing dependencies where the
> > function print_all_libs_info() uses data from libs that may not have
> > actually been built for the current configuration (A common offender here
> > is avresample).
> >
> > This adds a fix that puts some preprocessor guards so only headers and
> data
> > for libs that are actually built using the current configuration are
> used.
> >
> > This was obviously previously in ffmpeg as the comment on line 28 would
> > suggest:
> > /* Include only the enabled headers since some compilers (namely, Sun
> >    Studio) will not omit unused inline functions and create undefined
> >    references to libraries that are not being built. */
> >
> > At some point these were removed but this patch readds them in order to
> fix
> > a linker error with standard release settings for icl.
>
> has sun written multiple compilers ?
> because the only sun compiler i have seems working fine:
>
> http://fate.ffmpeg.org/report.cgi?time=20140206172840&slot=x86-opensolaris-suncc5.10
>
> also if(0) is used alot, and removing just one as a hack to make just
> one (default i assume) build working seems a bit inconsistant
>
> also why does your icl not optimize of if(0) code?
>
> [...]
>
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Freedom in capitalist society always remains about the same as it was in
> ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
The default on Windows for icl is to by default automatically enable /Qipo
which causes the linker errors. If set to a lower optimization level of
/Qip then the compiler will optimize out the if(0). So its a windows intel
compiler issue where its trying to resolve link dependencies before
performing additional optimizations.

The existing comment in the file suggests that at some point someone had
them preprocessor guarded for a reason that was then later removed. So at
the very least at present there is a comment in the file relating to stuff
that is no longer there.

Given that config.h is already included and there are many other instances
that remove code based on the config defines then keeping that consistent
throughout the code wouldnt be a problem. Even if it compiled using the
existing gcc toolchains etc. should we really be relying on the compiler to
optimise out unnecessary code anyway? Given its an easy fix that wont brake
anything and intel on windows defaulting to /Qipo is a clear case of it
causing issues then I figure why leave it.


More information about the ffmpeg-devel mailing list