瀏覽代碼

configure: add configure option for fstack-protector-all which is enabled by default, and disable it when compiling for MIC architectures

Nathalie Furmento 8 年之前
父節點
當前提交
514a859d3b
共有 2 個文件被更改,包括 6 次插入3 次删除
  1. 5 2
      configure.ac
  2. 1 1
      mic-configure

+ 5 - 2
configure.ac

@@ -1480,6 +1480,7 @@ AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug], [enable debug mode])],
 AC_MSG_RESULT($enable_debug)
 
 AC_ARG_ENABLE(spinlock_check, [AS_HELP_STRING([--enable-spinlock-check], [enable spinlock check])], enable_spinlock_check=$enableval, enable_spinlock_check=no)
+AC_ARG_ENABLE(fstack-protector-all, [AS_HELP_STRING([--enable-fstack-protector-all], [enable GCC option -fstack-protector-all])], enable_fstack_protector_all=$enableval, enable_fstack_protector_all=yes)
 
 if test x$enable_debug = xyes; then
 	AC_DEFINE(STARPU_DEBUG, [1], [enable debugging statements])
@@ -1488,8 +1489,10 @@ if test x$enable_debug = xyes; then
 	enable_spinlock_check=yes
 	if test x$GCC = xyes; then
 		if test x$starpu_windows != xyes ; then
-			CFLAGS="$CFLAGS -fstack-protector-all"
-			CXXFLAGS="$CXXFLAGS -fstack-protector-all"
+			if test x$enable_fstack_protector_all = xyes ; then
+			   CFLAGS="$CFLAGS -fstack-protector-all"
+			   CXXFLAGS="$CXXFLAGS -fstack-protector-all"
+			fi
 		fi
 	fi
 else

+ 1 - 1
mic-configure

@@ -127,7 +127,7 @@ do
 	fi
 
 	declare -a params
-	params=("--prefix=$prefix/$arch")
+	params=("--prefix=$prefix/$arch --disable-fstack-protector-all")
 
 	if [ "$native_mic" -eq "0" ]
 	then