diff options
author | Shiyou Yin <yinshiyou-hf@loongson.cn> | 2018-08-24 17:22:12 +0800 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-08-27 23:30:54 +0200 |
commit | e13e52fd0de68f2805e2e8a83d00ee28f9000c8a (patch) | |
tree | 128913f9f22d45272745e24dd47bb78bc5ebf405 /configure | |
parent | ad2ac1e7dd9053bf07225f7e9be29c7d2cbdeaf1 (diff) | |
download | ffmpeg-e13e52fd0de68f2805e2e8a83d00ee28f9000c8a.tar.gz |
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@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -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 ;; |