[FFmpeg-cvslog] configure: [loongson] revert no-expensive-optimizations
Shiyou Yin
git at videolan.org
Tue Aug 28 00:36:04 EEST 2018
ffmpeg | branch: master | Shiyou Yin <yinshiyou-hf at loongson.cn> | Fri Aug 24 17:22:12 2018 +0800| [e13e52fd0de68f2805e2e8a83d00ee28f9000c8a] | committer: Michael Niedermayer
configure: [loongson] revert no-expensive-optimizations
Add gcc version check before add -fno-expensive-optimizations flag.
Only when gcc version is lower than 5.3.0, this flag is needed.
More bug info see:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67736
https://gcc.gnu.org/ml/gcc-patches/2012-05/msg00401.html
Signed-off-by: Shiyou Yin <yinshiyou-hf at loongson.cn>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e13e52fd0de68f2805e2e8a83d00ee28f9000c8a
---
configure | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index 135e8cb789..3cf9412947 100755
--- a/configure
+++ b/configure
@@ -4819,15 +4819,24 @@ elif enabled mips; then
disable mipsfpu
disable mipsdsp
disable mipsdspr2
+ # When gcc version less than 5.3.0, add -fno-expensive-optimizations flag.
+ if [ $cc == gcc ]; then
+ gcc_version=$(gcc -dumpversion)
+ if [ "$(echo "$gcc_version 5.3.0" | tr " " "\n" | sort -rV | head -n 1)" == "$gcc_version" ]; then
+ expensive_optimization_flag=""
+ else
+ expensive_optimization_flag="-fno-expensive-optimizations"
+ fi
+ fi
case $cpu in
loongson3*)
- cpuflags="-march=loongson3a -mhard-float -fno-expensive-optimizations"
+ cpuflags="-march=loongson3a -mhard-float $expensive_optimization_flag"
;;
loongson2e)
- cpuflags="-march=loongson2e -mhard-float -fno-expensive-optimizations"
+ cpuflags="-march=loongson2e -mhard-float $expensive_optimization_flag"
;;
loongson2f)
- cpuflags="-march=loongson2f -mhard-float -fno-expensive-optimizations"
+ cpuflags="-march=loongson2f -mhard-float $expensive_optimization_flag"
;;
esac
;;
More information about the ffmpeg-cvslog
mailing list