From 989e5df1ebe58684d9950f1ee041b20d7224a85d Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 17 Nov 2017 21:57:32 +0100 Subject: [PATCH] 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. --- NEWS.md | 4 ++++ ac/debugging_profiling.m4 | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 343005b30..774b675d2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 diff --git a/ac/debugging_profiling.m4 b/ac/debugging_profiling.m4 index 5dd66845a..3aaabdc75 100644 --- a/ac/debugging_profiling.m4 +++ b/ac/debugging_profiling.m4 @@ -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"