[FFmpeg-devel] PIC and YASM

Reimar Döffinger Reimar.Doeffinger
Mon Nov 9 20:07:17 CET 2009


On Mon, Nov 09, 2009 at 08:26:05PM +0300, Michael Kostylev wrote:
> 
> On Mon Nov  9 18:02:54 2009
> Reimar D?ffinger wrote:
> 
> >>> @@ -1919,7 +1917,6 @@
> >>>          ;;
> >>>      openbsd)
> >>>          enable malloc_aligned
> >>> -        enable pic
> >> 
> >> OpenBSD builds fail without that currently.  Does your new __PIC__
> >> check fix that?
> > 
> > I expect
> 
> Unfounded.

Interesting. I do not know 100% what OpenBSD does, but FFmpeg builds
just with with PIC disabled, the generated program just does not run.
However, I'd like to suggest the change below.
Thing is, when PIC is enabled we already take the performance hit
anyway, so I suggest we at least try to also get the security benefit
by linking the executable programs as PIE.
What do you think about that? Any known issues with -pie linker flag?

Index: configure
===================================================================
--- configure   (revision 20476)
+++ configure   (working copy)
@@ -2103,6 +2103,7 @@
     add_cppflags -DPIC
     add_cflags   -fPIC
     add_asflags  -fPIC
+    add_ldflags  -pie
 }
 
 enabled pic && enable_pic



More information about the ffmpeg-devel mailing list