Commit 2b1d153a authored by Ian Lynagh's avatar Ian Lynagh
Browse files

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.
parent d2b30a14
...@@ -23,6 +23,15 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS], ...@@ -23,6 +23,15 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
$3="$$3 -m64" $3="$$3 -m64"
;; ;;
esac 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]) ...@@ -966,9 +975,6 @@ AC_SUBST([GhcPkgCmd])
# reordering things in the module and confusing the manger and/or splitter. # reordering things in the module and confusing the manger and/or splitter.
# (eg. Trac #1427) # (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_DEFUN([FP_GCC_EXTRA_FLAGS],
[AC_REQUIRE([FP_HAVE_GCC]) [AC_REQUIRE([FP_HAVE_GCC])
AC_CACHE_CHECK([for extra options to pass gcc when compiling via C], [fp_cv_gcc_extra_opts], 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_ ...@@ -994,12 +1000,6 @@ AC_CACHE_CHECK([for extra options to pass gcc when compiling via C], [fp_cv_gcc_
[]) [])
;; ;;
esac 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) AC_SUBST([GccExtraViaCOpts],$fp_cv_gcc_extra_opts)
]) ])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment