[FFmpeg-devel] [PATCH v6 1/3] mips: improve detection of ISAs, FPU and ASEs (DSP, MSA)

Vicente Olivert Riera Vincent.Riera at imgtec.com
Wed Jan 20 13:21:37 CET 2016

On 20/01/16 12:05, Michael Niedermayer wrote:
> On Wed, Jan 20, 2016 at 11:37:52AM +0000, Vicente Olivert Riera wrote:
>> Hello Michael,
>> On 19/01/16 22:11, Michael Niedermayer wrote:
>>> On Thu, Jan 14, 2016 at 02:59:03PM +0000, Vicente Olivert Riera wrote:
>>>> Signed-off-by: Vicente Olivert Riera <Vincent.Riera at imgtec.com>
>>>> ---
>>>> Changes v5 -> v6:
>>>>  - Multiple changes:
>>>>    - Use separate if blocks when detecting the MIPS ISA, this way when a block
>>>>      disables one ISA it will be detected by the next one. Before the elif was
>>>>      preventing this to be done.
>>>>    - Don't use check_cflags and use only check_ldflags instead, which will
>>>>      check if that flag is valid for compiling and linking. The compiler may
>>>>      accept some cflags for compiling but not for linking, so if we check first
>>>>      for the cflags it will succeed, and the cflags will be added to the CFLAGS
>>>>      variable despite of the check_ldflags failing after that. This can cause
>>>>      problems because of having multiple incompatible cflags enabled at the same
>>>>      time.
>>>>    - Check if mipsfpu has been disabled, and if so, then use -msoft-float. This
>>>>      way we override the compiler default behavious which can be building for
>>>>      hard-float.
>>>>    - Explicitly disable the features that fail any check by adding "|| disable
>>>>      $feature" at the end of the checks chain.
>>>> Changes v4 -> v5:
>>>>  - Check for msa.h and disable msa if not found.
>>>> Changes v3 -> v4:
>>>>  - Nothing.
>>>> Changes v2 -> v3:
>>>>  - Nothing.
>>>> Changes v1 -> v2:
>>>>  - Add a block of code for mipsdspr2 which was previously placed in the
>>>>    first patch of this series causing a syntax error in the configure
>>>>    script.
>>>>    https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2015-November/183444.html
>>> make distclean ; ../configure --cross-prefix=/usr/mips-linux-gnu/bin/ --cc='ccache mips-linux-gnu-gcc-4.4' --arch=mips --target-os=linux --enable-cross-compile  --disable-mipsfpu && make -j12
>>> results in pages of:
>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: Warning: libavfilter/filtfmts-test uses hard float, libswresample/libswresample.a(dither.o) uses soft float
>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: Warning: libavfilter/filtfmts-test uses hard float, libswresample/libswresample.a(resample.o) uses soft float
>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: Warning: libavfilter/filtfmts-test uses hard float, libswresample/libswresample.a(resample_dsp.o) uses soft float
>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: Warning: libavfilter/filtfmts-test uses hard float, libavutil/libavutil.a(adler32.o) uses soft float
>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: Warning: libavfilter/filtfmts-test uses hard float, libavutil/libavutil.a(aes.o) uses soft float
>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: Warning: libavfilter/filtfmts-test uses hard float, libavutil/libavutil.a(aes_ctr.o) uses soft float
>>> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: Warning: libavfilter/filtfmts-test uses hard float, libavutil/libavutil.a(audio_fifo.o) uses soft float
>>> [...]
>> I can't reproduce your issue. Look:
>> $ make distclean ; ./configure --cross-prefix=mips-linux-gnu-
>> --arch=mips --target-os=linux --enable-cross-compile --disable-mipsfpu
>> And then:
>> $ make -j1 V=1 2>&1 | tee build.log
>> And then:
>> $ grep "uses soft float" build.log
>> $ grep "filtfmts-test" build.log
>> It gives me nothing.
>> Also I try to find for that filtfmts-test file which your logs say that
>> is using hard-float, and I cannot find it:
>> $ find . -name "filtfmts-test*"
>> $
> see libavfilter/filtfmts.c

But do you have a generated filtfmts-test binary or a filtfmts.o file?
Because when my build is finished I don't any anything of that.

> our compilers differ
> the one i have here is a binary from emdebian
> are you droping support for that ?
> if so that should be clearly stated in the commit message, and  the
> compiler cleanly detected and a clear warning given to the user why
> his/her compiler isnt supported and what is supported

Well, my intention isn't dropping support for anything, although this is
what the emdebian website says:

"Status of Emdebian distributions

As of July 2014, updates to the Emdebian distributions ceased. There
will be no further updates and no further stable releases."

Anyway, how can I obtain the same compiler as you have in order to try
reproducing the bug?

> make distclean ; ../configure --cross-prefix=/usr/mips-linux-gnu/bin/ --cc='mips-linux-gnu-gcc-4.4' --arch=mips --target-os=linux --enable-cross-compile  --disable-mipsfpu && make -j12  >& build
> grep 'uses soft float' build | wc
> 2327   24879  389225
> echo 'int main(void){ return 0; }' | mips-linux-gnu-gcc-4.4  -x c - -o out.o
> echo 'int main(void){ return 0; }' | mips-linux-gnu-gcc-4.4  -x c - -o out.o -msoft-float
> /usr/lib/gcc/mips-linux-gnu/4.4.5/../../../../mips-linux-gnu/bin/ld: Warning: out.o uses hard float, /tmp/ccFlutMG.o uses soft float

But I don't understand how your compiler built something for hard-float
when the -msoft-float option should be used instead. This is what I have
(note that I passed V=1 to the make command):

$ grep '\-mhard-float' build.log | wc -l
$ grep '\-msoft-float' build.log | wc -l
$ grep "mips-linux-gnu-gcc" build.log | wc -l

So the -mhard-float option wasn't used at all, and the -msoft-float one
was used every time the compiler was called.

I'm curious, can you show me your output for those same commands, please?



More information about the ffmpeg-devel mailing list