[Ffmpeg-devel] [BUG] Compilation failure when using --disable-opts

Diego Biurrun diego
Wed Mar 14 21:41:49 CET 2007


On Wed, Mar 14, 2007 at 09:32:51PM +0100, Panagiotis Issaris wrote:
> 
> M?ns Rullg?rd schreef:
> > Panagiotis Issaris <takis.issaris at uhasselt.be> writes:
> > 
> >> +int main(){
> >> +    volatile int i=0;
> >> +    asm volatile (
> >> +        "xorl %%ebp, %%ebp"
> >> +    ::: "%ebp");
> >> +    return i;
> >> +}
> >> +EOF
> > 
> > And what's the "int i" good for?
> The 'i' is set at the beginning of the program, and so base pointer will
> be used to initialize it (it is on the stack). At the end of the program
> the the contents of 'i' is the returnvalue of the program and so the
> base pointer will again be used to get at the value of 'i'. As it is set
> to zero by the inline assembly code, a 0+offset pointer will be
> dereferenced caused a segfault. Without the 'i' or with
> -fomit-frame-pointer this won't happen.

Could you add a comment?  This is non-intuitive..

Diego





More information about the ffmpeg-devel mailing list