[FFmpeg-cvslog] r20497 - trunk/configure

Reimar Döffinger Reimar.Doeffinger
Sun Nov 15 10:54:07 CET 2009


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.

> 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?
There is no point in compiling the code as PIC without enable-shared for
what I can tell, especially not to force -mdynamic-no-pic of.
The only reason I can think of is adding support for PIE-builds, and
then we'd need a separate configure flag for that anyway (and additional
linker flags, in the case of --enable-shared linker flags that will only
be added when linking the binaries - or alternatively moving the
SHFLAGS after the LDFLAGS in the call add -pie to LDFLAGS and -nopie to
SHFLAGS might work, too).



More information about the ffmpeg-cvslog mailing list