[FFmpeg-devel] Debug builds and if (ARCH_...) linking issues

Matt Oliver protogonoi at gmail.com
Sun Apr 16 18:57:47 EEST 2017


On 14 April 2017 at 08:05, Hendrik Leppkes <h.leppkes at gmail.com> wrote:

> On Fri, Apr 14, 2017 at 12:00 AM, Ronald S. Bultje <rsbultje at gmail.com>
> wrote:
> > Hi Aaron,
> >
> > On Thu, Apr 13, 2017 at 4:47 PM, Aaron Levinson <alevinsn at aracnet.com>
> > wrote:
> >
> >> #if ARCH_AARCH64
> >>     if (ARCH_AARCH64)
> >>         return ff_get_cpu_flags_aarch64();
> >> #endif
> >>
> >
> > If you add #if, at least replace the if with it. #if + if is redundant.
> >
> >
> >> Such a script could be reviewed and checked into the source base, then
> >> applied to the source base, and possibly reused in the future as
> necessary.
> >
> >
> > Why not use the script as a preprocessor during compilation? We did that
> > for pre-2013 MSVC compilation and that worked """fine""".
> >
> > Or why not ask Microsoft to add a CLI option to cl.exe for enabling DCE
> but
> > otherwise disabling optimizations? All other compilers seem capable of
> > this, so it's odd to see that big Microsoft is incompetent whereas a
> bunch
> > of opensource hippies could do the same 10+ yrs ago.
> >
>
> Its not a MSVC-exclusive problem. Many compilers don't perform DCE in
> full debug builds, which are as such not possible with ffmpeg, making
> debuging sometimes a bit annoying when a bunch of variables are
> optimized out and stuff gets inlined.


Unfortunately writing a script is a rather complex task as there are many
DCE blocks that are actually generated by macro expansion and various
pre-processor trickery (swresample is full of this sort of stuff). Combine
that with DCE blocks being nested within each other and it becomes a rather
complex task to find them all. Much more complex than what a simple regex
script can handle.

If people object to changing the current code base then the only solution
would be a program/script that can generate some empty definitions for all
the functions/variables that are used in DCE blocks so as to avoid the
errors about them not existing. These empty definitions would have to be
maintained in a set of external files or generated at compile time.

There are actually a considerable number of missing funcs/vars used in DCE
blocks. As an example i have attached a list of empty funcs/vars that I
have been able to programmatically detect (there are a lot! and i may have
missed some).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg_dce_defs.c
Type: text/x-csrc
Size: 2906 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170417/cd379465/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffplay_dce_defs.c
Type: text/x-csrc
Size: 2906 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170417/cd379465/attachment-0001.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffprobe_dce_defs.c
Type: text/x-csrc
Size: 2907 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170417/cd379465/attachment-0002.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: avcodec_dce_defs.c
Type: text/x-csrc
Size: 534022 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170417/cd379465/attachment-0003.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: avdevice_dce_defs.c
Type: text/x-csrc
Size: 3714 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170417/cd379465/attachment-0004.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: avfilter_dce_defs.c
Type: text/x-csrc
Size: 65119 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170417/cd379465/attachment-0005.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: avformat_dce_defs.c
Type: text/x-csrc
Size: 36789 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170417/cd379465/attachment-0006.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: avutil_dce_defs.c
Type: text/x-csrc
Size: 7640 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170417/cd379465/attachment-0007.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: swresample_dce_defs.c
Type: text/x-csrc
Size: 12163 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170417/cd379465/attachment-0008.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: swscale_dce_defs.c
Type: text/x-csrc
Size: 16808 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170417/cd379465/attachment-0009.c>


More information about the ffmpeg-devel mailing list