[FFmpeg-devel] [PATCH]Allow to compile with --disable-optimizations with icc

Pavel Pavlov pavel
Sun May 2 22:17:33 CEST 2010

> -----Original Message-----
> Sent: Sunday, May 02, 2010 3:07 PM
> To: ffmpeg-devel at mplayerhq.hu
> Subject: Re: [FFmpeg-devel] [PATCH]Allow to compile with --disable-
> optimizations with icc
> Carl Eugen Hoyos <cehoyos <at> ag.or.at> writes:
> > > Currently, icc compilation fails with --disable-optimizations,
> > > because icc does not optimize symbols away with -O0:
> >
> > I missed the reason for -O0: For icc, -g implies -O0 So the new line
> > should actually be:
> > disabled optimizations && enabled debug && check_cflags -O1
> I will apply this variant next week if nobody objects.
> Carl Eugen

I had the same problem. I use icl (intel windows compiler) in order to be able to debug with visual studio in case if I have problems. If I do a debug build then I get link errors for all symbols that are like these for example:
If(CONFIG_LIB_RTMP){ extern void * rtmp_whatever ; register_encoder(rtmp_whatever); }
I would get rtmp_whatever undefined link error.
It's not difficult to work around that problem by bumping up optimization level to -O1 for example. The problem with this workaround is that intel compiler even at -O1 level generates completely different code that is very difficult to debug  (all instructions are reordered, when stepping trough with debugger in many places it just jumps from one line to another and looks bizarre, but that's how it optimizes code). So, whenever I really had to step through the code, I had to modify files by changing

I tried to add other options like inlining or whatever, but always I'd get link errors and the only way to avoid it was to add optimization level which makes it very close to full optimization level. Maybe somebody on intel forums could help with that, but I didn't ask.

PS : CONFIG_LIB_RTMP has nothing to do that link error that I was getting, it was related to some cpu tests.

More information about the ffmpeg-devel mailing list