configure: use -O3 with clang++ 3.8.0 or newer

Older versions suffered from excessive memory usage with optimization
levels higher than `-O1`:

%https://bugs.llvm.org/show_bug.cgi?id=11962

v3.8.0 is known to be OK, though.
This commit is contained in:
Moritz Bunkus 2017-11-17 21:57:32 +01:00
parent de093c2913
commit 989e5df1eb
2 changed files with 5 additions and 1 deletions

View File

@ -13,6 +13,10 @@
removed during code refactoring in release v15.0.0.
* mkvmerge: AVC & HEVC ES parsers: performance improvements by copying much
less memory around.
* build system: when building with clang v3.8.0 or newer, `configure` will no
longer restrict optimization flags to `-O1` and use `-O3` again (older
versions of clang suffered from excessive memory usage with higher
optimization levels).
## Bug fixes

View File

@ -34,7 +34,7 @@ else
fi
if test x"$enable_optimization" = xyes; then
if test x"$ac_cv_compiler_is_clang" = xyes; then
if test x"$ac_cv_compiler_is_clang" = xyes && ! check_version 3.8.0 $ac_cv_compiler_version; then
opt_features_no="$opt_features_no\n * full optimization: due to bug 11962 in LLVM/clang only -O1 will be used for optimization"
OPTIMIZATION_CFLAGS="-O1"