]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
configure.ac: Detect support for -faligned-new
authorBart Van Assche <bart.vanassche@wdc.com>
Sat, 17 Mar 2018 22:01:35 +0000 (15:01 -0700)
committerBart Van Assche <bart.vanassche@wdc.com>
Sun, 18 Mar 2018 04:31:53 +0000 (21:31 -0700)
configure.ac

index 98d7ac6e5b6c9bbc9fe220bb284b134de2568cf7..3988d62c63197277609f5e2aee4cdb48bd6d68b1 100644 (file)
@@ -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])