[MPlayer-dev-eng] Linking mplayer fails

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Apr 1 14:42:10 CEST 2013


On 1 Apr 2013, at 13:57, Xidorn Quan <quanxunzhen at gmail.com> wrote:
> On Mon, Apr 1, 2013 at 7:24 PM, Dan Oscarsson <Dan.Oscarsson at tieto.com>wrote:
> 
>> mån 2013-04-01 klockan 12:44 +0200 skrev Grozdan:
>>> On Mon, Apr 1, 2013 at 12:40 PM, Dan Oscarsson <Dan.Oscarsson at tieto.com
>>> wrote:
>>> 
>>>> mån 2013-04-01 klockan 12:22 +0200 skrev Nicolas George:
>>>>> Le duodi 12 germinal, an CCXXI, Dan Oscarsson a écrit :
>>>>>> Tried to create mplayer under opensuse 12.3 but linking fails with:
>>>>>> 
>>>>>> 
>>>> 
>> /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld:
>>>> libmpcodecs/vf_fspp.o: relocation R_X86_64_32S against `.rodata' can
>> not be
>>>> used when making a shared object; recompile with -fPIC
>>>>>> libmpcodecs/vf_fspp.o: could not read symbols: Bad value
>>>>>> collect2: error: ld returned 1 exit status
>>>>> 
>>>>> Wild guess: try to revert 36098.
>>>>> 
>>>> 
>>>> If I get that by doing:
>>>> svn co -r 36098 svn://svn.mplayerhq.hu/mplayer/trunk mplayer
>>>> 
>>>> it does not help. Same failure.
>>>> 
>>> 
>>> I'm on openSUSE 12.3 myself and revision 36090 works here so you may want
>>> to check that out
>> 
>> Yes, it works.
>> Tested many more revisions. 36097 is OK. 36098 is not.
>> 
>> The difference seams to be related to PIC.
>> Working version have #define CONFIG_PIC 1 in mplayer/config.h, but set
>> to 0 in revision 36098.
>> 
> 
> It looks really strange. Before I committed the revision 36098,
> mplayer could not be compiled in my OS X because of the same reason
> you found for the current revision. It seems that compilers have
> different behaviors for the default value of PIC flag. I guess that
> what the compiler in my system does is wrong.
> 
> However, I suggest to unconditionally add the PIC flag which is that
> configure of ffmpeg actually does. It is obvious that compilation will
> fail without this flag in many situations.

Both are somewhat wrong.
We should not add PIC where it would result in unnecessarily slow code.
I might miss some details here, but in general what should happen is:
On x86-64 PIE should also set CONFIG_PIC.
On x86-32 it should not set CONFIG_PIC unless the compiler forces it (e.g. Gentoo hardened, OSX (?)).
I am not sure about any other systems, but since we do not enable PIE by default for them it should't matter much.


More information about the MPlayer-dev-eng mailing list