[MPlayer-dev-eng] Linking mplayer fails

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Apr 1 20:06:01 CEST 2013



On 1 Apr 2013, at 19:30, Alex Romosan <romosan at sycorax.lbl.gov> wrote:

> Alex Romosan <romosan at sycorax.lbl.gov> writes:
> 
>> Reimar Döffinger <Reimar.Doeffinger at gmx.de> writes:
>> 
>>> Hardcoding the broken compilers is certainly going to be easier,
>>> though we'd need more information since I've compiled MPlayer just
>>> fine on OSX with both gcc and clang.
>> 
>> this is on linux x86_64 and gcc 4.7. looking at the log:
>> 
>> ============ Checking for PIC ============
>> 
>> 
>> #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
>> #error condition not true: defined(__PIC__) || defined(__pic__) || defined(PIC)
>> #endif
>> int main(void) { return 0; }
>> 
>> cc -Wundef -Wall -Wno-switch -Wno-parentheses -Wpointer-arith
>> -Wredundant-decls -Wstrict-prototypes -Wmissing-prototypes
>> -Wdisabled-optimization -Wno-pointer-sign
>> -Wdeclaration-after-statement -std=gnu99
>> -Werror-implicit-function-declaration -D_POSIX_C_SOURCE=200112
>> -D_XOPEN_SOURCE=600 -D_ISOC99_SOURCE -I. -Iffmpeg -O4 -march=native
>> -mtune=native -pipe -ffast-math -fomit-frame-pointer
>> -fno-tree-vectorize /tmp/mplayer-configure-5914-5626/tmp.c -ffast-math
>> -o /tmp/mplayer-configure-5914-5626/tmp -lm
>> /tmp/mplayer-configure-5914-5626/tmp.c:3:2: error: #error condition
>> not true: defined(__PIC__) || defined(__pic__) || defined(PIC)
>> 
>> 
>> Result is: no 
>> 
>> but when testing for PIC don't you want to add -fPIC to the compiler
>> test?
> 
> so shouldn't the test be something like this:
> 
> --- configure   (revision 36131)
> +++ configure   (working copy)
> @@ -2764,7 +2764,7 @@
> echocheck "PIC"
> def_pic='#define CONFIG_PIC 0'
> pic=no
> -cpp_condition_check '' 'defined(__PIC__) || defined(__pic__) || defined(PIC)' &&
> +cpp_condition_check '' 'defined(__PIC__) || defined(__pic__) || defined(PIC)' '-fPIC'  &&
>   pic=yes && extra_cflags="$extra_cflags -DPIC" && def_pic='#define CONFIG_PIC 1'
> echores $pic
> 
> with this applied i can get mplayer to link.

No, that will completely break it! The point is to detect whether the (assembler) code we create must be PIC, not forcing the compiler to generate PIC code!
PIC is not something we should _ever_ enable by default as your suggestion does, but only if we have to.


More information about the MPlayer-dev-eng mailing list