summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2010-08-19 23:30:31 +0000
committerIan Lynagh <igloo@earth.li>2010-08-19 23:30:31 +0000
commit2b1d153a60b9f8720bda74180d50a0aed2d02af2 (patch)
treef960a8bd434886e08ea3472a491dffc802d58033
parentd2b30a14b7b21ba17220cf14f3abd3868b5fa5d2 (diff)
downloadhaskell-2b1d153a60b9f8720bda74180d50a0aed2d02af2.tar.gz
Set -fno-stack-protector in CONF_CC_OPTS_STAGE* rathre than extra-gcc-opts
The latter is only used when compiling .hc files, whereas we need it for .c files too.
-rw-r--r--aclocal.m418
1 files changed, 9 insertions, 9 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index e0cae15acf..a5132f027a 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -23,6 +23,15 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
$3="$$3 -m64"
;;
esac
+
+ # If gcc knows about the stack protector, turn it off.
+ # Otherwise the stack-smash handler gets triggered.
+ echo 'int main(void) {return 0;}' > conftest.c
+ if $CC -c conftest.c -fno-stack-protector > /dev/null 2>&1
+ then
+ $2="$$2 -fno-stack-protector"
+ fi
+ rm conftest.c conftest.o
])
@@ -966,9 +975,6 @@ AC_SUBST([GhcPkgCmd])
# reordering things in the module and confusing the manger and/or splitter.
# (eg. Trac #1427)
#
-# If gcc knows about the stack protector, turn it off.
-# Otherwise the stack-smash handler gets triggered.
-#
AC_DEFUN([FP_GCC_EXTRA_FLAGS],
[AC_REQUIRE([FP_HAVE_GCC])
AC_CACHE_CHECK([for extra options to pass gcc when compiling via C], [fp_cv_gcc_extra_opts],
@@ -994,12 +1000,6 @@ AC_CACHE_CHECK([for extra options to pass gcc when compiling via C], [fp_cv_gcc_
[])
;;
esac
- echo 'int main(void) {return 0;}' > conftest.c
- if $CC -c conftest.c -fno-stack-protector > /dev/null 2>&1
- then
- fp_cv_gcc_extra_opts="$fp_cv_gcc_extra_opts -fno-stack-protector"
- fi
- rm conftest.c conftest.o
])
AC_SUBST([GccExtraViaCOpts],$fp_cv_gcc_extra_opts)
])