[MPlayer-dev-eng] Linking mplayer fails
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Tue Apr 2 11:52:30 CEST 2013
On Tue, Apr 02, 2013 at 09:19:08AM +0800, Xidorn Quan wrote:
> On Tue, Apr 2, 2013 at 2:26 AM, Reimar Döffinger
> <Reimar.Doeffinger at gmx.de>wrote:
> > A better way would be to actually test if linking non-PIC code actually
> > works.
> > Also, do you know if it is only the missing CONFIG_PIC that causes the
> > linking failure or if we actually need to explicitly add -fPIC if we use
> > PIE?
> >
>
> For me, it is not a linking failure. It fails when compiling as I mentioned
> before. If I add -DPIC to YASMFLAGS in config.mak directly, it passes
> compilation but fails to link.
Can you try this patch (others are welcome to test as well):
Index: configure
===================================================================
--- configure (revision 36133)
+++ configure (working copy)
@@ -2851,9 +2851,15 @@
echocheck "PIC"
def_pic='#define CONFIG_PIC 0'
pic=no
-cpp_condition_check '' 'defined(__PIC__) || defined(__pic__) || defined(PIC)' &&
- pic=yes && extra_cflags="$extra_cflags -DPIC" && def_pic='#define CONFIG_PIC 1'
+cpp_condition_check '' 'defined(__PIC__) || defined(__pic__) || defined(PIC)' && pic=yes
+if x86_64 && test "$relocatable" = "yes" && test "$pic" = "no"; then
+ res_comment="Broken compiler incorrectly claims PIC not necessary for PIE"
+ pic=yes
+fi
echores $pic
+if test "$pic" = "yes" ; then
+ extra_cflags="$extra_cflags -DPIC" && def_pic='#define CONFIG_PIC 1'
+fi
def_bswap='#define HAVE_BSWAP 0'
More information about the MPlayer-dev-eng
mailing list