[FFmpeg-devel] [PATCH] mipsen require compilation with -DPIC since gcc-4.3

Måns Rullgård mans
Tue Sep 23 11:30:00 CEST 2008


Diego Biurrun wrote:
> On Mon, Sep 22, 2008 at 10:19:47AM +0200, Reinhard Tartler wrote:
>> M?ns Rullg?rd <mans at mansr.com> writes:
>>
>> > Mentioning this in the original email would have spared us this
>> > discussion.  Do you have a reference for that?
>>
>> Quoting from http://gcc.gnu.org/gcc-4.3/changes.html
>>
>> MIPS
>> Changes to existing configurations
>>
>>     [...]
>>     * GNU/Linux configurations now generate -mno-shared code unless
>>       overridden by -fpic, -fPIC, -fpie or -fPIE.
>>     [...]
>>
>> You can verify Thiemo as Linux/MIPS gcc upstream developer by checking
>> your gcc changelog.
>>
>> Btw, MIPS has only very recently added non-PIC executable
>> support. c.f.
>> http://www.linux-mips.org/archives/linux-mips/2008-06/msg00280.html
>>
>> In short, there is no performance penalty with adding this switch at
>> all. GCC 4.3 brings some performance when linking ffmpeg statically, but
>> breaks when compiled at shared libs now.  ths told me in private query
>> that the fact that it did not fail was sheer luck. The fact that it ld
>> doesn't fail can be considered as a bug.
>>
>> What else references do you need for this single one-liner?!
>
> What would be a good commit message for this?  My current draft is:
>
> Add MIPS to list of architectures requiring PIC flags.
> gcc used to do this automatically because non-PIC builds were not
> supported.  Starting with gcc 4.3 non-PIC static builds are
> supported and the flag has to be passed explicitly.

That is inaccurate.  If I understood the discussion correctly, gcc
always supported non-PIC, but PIC was default prior to 4.3.

Building entirely statically linked MIPS executables has been supported
by gcc/ld since the beginning of time, or at least since I started doing
it on a daily basis years ago.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list