[FFmpeg-cvslog] r20497 - trunk/configure

David Conrad lessen42
Sun Nov 15 19:48:46 CET 2009

On Nov 15, 2009, at 7:02 AM, M?ns Rullg?rd wrote:

> Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:
>> On Sun, Nov 15, 2009 at 01:58:12AM -0500, Alexander Strange wrote:
>>> On Nov 14, 2009, at 10:38 PM, M?ns Rullg?rd wrote:
>>>> Alexander Strange <astrange at ithinksw.com> writes:
>>>>> On Nov 10, 2009, at 7:57 AM, reimar wrote:
>>>>>> Author: reimar
>>>>>> Date: Tue Nov 10 13:57:28 2009
>>>>>> New Revision: 20497
>>>>>> Log:
>>>>>> Check if PIC is somehow already enabled (e.g. a compiler that enables it by default).
>>>>>> This in particular ensures that -DPIC is set appropriately for YASM, which avoids
>>>>>> linking failures on x86_64 for compilers that have PIE enabled by default
>>>>>> (e.g. hardened Gentoo).
>>>>>> It also makes the macho64 special-case hack adding -DPIC to YASMFLAGS obsolete.
>>>>> This broke adding -mdynamic-no-pic on Darwin again.
>>>> Can you please explain what the problem is?
>>> The compiler defaults to PIC, so that check runs 'enable pic'.
>>> After that, -mdynamic-no-pic, which turns it off again, is under ! 'enabled_any pic shared', so it's not added.
>> Hm. It was specifically for that check I put this before it, however I
>> misread the condition.
> What does that flag do anyway?

Equivalent to -fno-pic on x86, but on PPC (where -fno-pic doesn't work) the code generated is not PIC except for references to shared libs, which are.

>>> Maybe it shouldn't be using the same variable for PIC being
>>> detected and the user specifically requesting it, but that won't
>>> fix this check, which either needs to not run for Darwin or to run
>>> after the flag is added.
>> Why is adding that flag conditional on PIC anyway?
> IIRC it was supposed to do something allowing non-pic code in shared
> libs.  Now that doesn't make much sense if, as you say, PIC is always
> on with that compiler.
> So which way is it?

PIC is on by default for all architectures. It cannot be disabled on x86-64 (-mdynamic-no-pic is accepted but ignored.) PPC shared libs require PIC (not 100% sure.) x86-32 doesn't require PIC for shared libs, though 10.5's linker warned about it.

On a side note, gcc 4.2 and above fails in multiple ways (compilation failure, miscompilations) on ffmpeg's inline asm on x86-32/darwin if PIC isn't disabled.

More information about the ffmpeg-cvslog mailing list