[FFmpeg-devel] [PATCH] use MANGLE in cavsdsp_mmx.c

Uoti Urpala uoti.urpala
Wed Sep 30 19:24:42 CEST 2009


On Wed, 2009-09-30 at 18:36 +0200, Reimar D?ffinger wrote:
> On Wed, Sep 30, 2009 at 07:17:33PM +0300, Uoti Urpala wrote:
> > In what sense does it "use PIC" if MANGLE works? MANGLE is only an
> > uglier and less robust way to get the same effect as you'd get by
> > compiling without -fPIC. So does the default compiler always force -fPIC
> > on, even though binaries compiled without that do work fine on the
> > platform? Or what?
> 
> No it's not the same thing, not using -fPIC can result in code that can
> not link at all on x86_64 systems while MANGLE (due to our hacked
> variant that does IP-relative) still works.

How's AMD64 relevant here? Certainly that's not running out of
registers. And the flags already differ between platforms.

Even on AMD64 your statement is only true with a suitable interpretation
- if you talk about different things in the "not link using -fPIC" and
"MANGLE still works" parts. The code below produces "a(%rip)" without
-fPIC, and generally things that work with MANGLE will work without
-fPIC too. What's possible is that other, different parts of code won't
work without -fPIC (and wouldn't work at all if they used MANGLE). 

And even with -fPIC the compiler would still generate the same direct
"a(%rip)" reference without using extra registers if it had correct
visibility information. Unfortunately it seems that Diego finally
preferred working on indentation changes instead of getting my
visibility patch integrated...


extern int a;
void f(void)
{
    asm (
         "%[a]"
         :[a]"=m"(a)
         :
         );
}

> But if you insist on being pedantic, I do s/uses PIC/the compiler
> behaves as with something like -fPIC -fPIE -pie set by default/

And there are no switches to turn that back off?




More information about the ffmpeg-devel mailing list