X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=aclocal.m4;h=5358cc2727d265ebd752d8b19fcec45ac5178d6f;hb=401140734891ca804c336122581743251d61b3a6;hp=fe83327fe70fcc1bb78c35f2a92d190b8da717bd;hpb=ee9a93fdb4e0830a27d87185d30bba6e2638e319;p=ghc-hetmet.git diff --git a/aclocal.m4 b/aclocal.m4 index fe83327..5358cc2 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -4,6 +4,24 @@ # ensure we don't clash with any pre-supplied autoconf ones. +# FPTOOLS_SET_C_LD_FLAGS +# ---------------------------------- +# Set the C and LD flags for a given platform +AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS], +[ + case $$1 in + i386-apple-darwin|powerpc-apple-darwin) + $2="$$2 -m32" + $3="$$3 -m32" + ;; + x86_64-apple-darwin) + $2="$$2 -m64" + $3="$$3 -m64" + ;; + esac +]) + + # FPTOOLS_FLOAT_WORD_ORDER_BIGENDIAN # ---------------------------------- # Little endian Arm on Linux with some ABIs has big endian word order @@ -944,6 +962,9 @@ 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], @@ -969,6 +990,12 @@ 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) ])