[flac-dev] [PATCH] configure.ac : Pass -fno-inline-small-functions when using GCC 4.7

Mario Sanchez Prada
2015-06-08T17:02:39Z

For some reason, the build fails when using GCC 4.7 due to the implicit
-finline-functions option passed to the compiler when -O3 is enabled,
which does not happen in newer versions of GCC, perhaps due to some of
the "General Optimizer Improvements" mentioned in GCC 4.8's
Release notes.

Fortunately, we don't need to disable -finline-functions completely but
just do it for "small functions", which is what this patch does.

Closes: https://sourceforge.net/p/flac/bugs/429/
---
 configure.ac | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/configure.ac b/configure.ac
index 6f34c66..9bfe7f5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -397,6 +397,10 @@ if test x$ac_cv_c_compiler_gnu = xyes ; then
 		XIPH_ADD_CFLAGS([-fgnu89-inline])
 		fi

+	if test "x$GCC_MAJOR_VERSION$GCC_MINOR_VERSION" = "x47" ;
then
+		XIPH_ADD_CFLAGS([-fno-inline-small-functions])
+		fi
+
 	if test "x$asm_optimisation$sse_os" = "xyesyes" ; then
 		XIPH_ADD_CFLAGS([-msse2])
 		fi
--
2.1.0