From a50f103c0fc42b8f664cebd8eae79494c92da69b Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Wed, 25 Mar 2015 10:31:10 -0700 Subject: [PATCH] opal_setup_cc.m4: don't use -finline-functions with clang Some versions of clang (at least >= 3.5 -- perhaps older versions, too?) will *warn* about -finline-functions, but still allow it. This is very annoying, so check for that warning, too. --- config/opal_setup_cc.m4 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/config/opal_setup_cc.m4 b/config/opal_setup_cc.m4 index aac1d950af..ddb897f0b2 100644 --- a/config/opal_setup_cc.m4 +++ b/config/opal_setup_cc.m4 @@ -196,12 +196,26 @@ AC_DEFUN([OPAL_SETUP_CC],[ if test "$GCC" = "yes"; then CFLAGS_orig="$CFLAGS" + # Note: Some versions of clang (at least >= 3.5 -- perhaps + # older versions, too?) will *warn* about -finline-functions, + # but still allow it. This is very annoying, so check for + # that warning, too. CFLAGS="$CFLAGS_orig -finline-functions" add= AC_CACHE_CHECK([if $CC supports -finline-functions], [opal_cv_cc_finline_functions], [AC_TRY_COMPILE([], [], - [opal_cv_cc_finline_functions="yes"], + [opal_cv_cc_finline_functions="yes" + if test -s conftest.err ; then + for i in unused 'not supported' ; do + $GREP -iq "$i" conftest.err + if test $? -eq 0; then + opal_cv_cc_finline_functions="no" + break; + fi + done + fi + ], [opal_cv_cc_finline_functions="no"])]) if test "$opal_cv_cc_finline_functions" = "yes" ; then add=" -finline-functions"