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

Michael Niedermayer michael at niedermayer.cc
Wed Jan 20 13:05:18 CET 2016


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

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

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


-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160120/216a8c51/attachment.sig>


More information about the ffmpeg-devel mailing list