From 025344ae807746e74b69d342cdcbb7b23ad853c7 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 17 Mar 2018 15:01:35 -0700 Subject: [PATCH] configure.ac: Detect support for -faligned-new --- configure.ac | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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]) -- 2.47.2