From: Bart Van Assche Date: Sat, 17 Mar 2018 22:01:35 +0000 (-0700) Subject: configure.ac: Detect support for -faligned-new X-Git-Tag: VALGRIND_3_14_0~141 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=025344ae807746e74b69d342cdcbb7b23ad853c7;p=thirdparty%2Fvalgrind.git configure.ac: Detect support for -faligned-new --- diff --git a/configure.ac b/configure.ac index 98d7ac6e5b..3988d62c63 100644 --- a/configure.ac +++ b/configure.ac @@ -2057,6 +2057,27 @@ else AC_SUBST([FLAG_W_CAST_ALIGN], [-Wcast-align]) fi +# does this compiler support -faligned-new ? +AC_MSG_CHECKING([if g++ accepts -faligned-new]) + +safe_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-faligned-new -Werror" + +AC_LANG(C++) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ + return 0; +]])], [ +FLAG_FALIGNED_NEW="-faligned-new" +AC_MSG_RESULT([yes]) +], [ +FLAG_FALIGNED_NEW="" +AC_MSG_RESULT([no]) +]) +CXXFLAGS=$safe_CXXFLAGS +AC_LANG(C) + +AC_SUBST(FLAG_FALIGNED_NEW) + # does this compiler support -fno-stack-protector ? AC_MSG_CHECKING([if gcc accepts -fno-stack-protector])