X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=aclocal.m4;h=a5132f027aa42fb0ddb122bc9672662bd592ec9e;hb=5ee7f0e66649ef31c2fcb2528399b57eba5651db;hp=747d064f2ad9c0be5b97593b3d56448940c2a384;hpb=593790400ecb8e6dbbef1ade3da56b1070ba155e;p=ghc-hetmet.git diff --git a/aclocal.m4 b/aclocal.m4 index 747d064..a5132f0 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -11,14 +11,27 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS], [ case $$1 in i386-apple-darwin|powerpc-apple-darwin) - $2="$$2 -m32" - $3="$$3 -m32" + # By default, gcc on OS X will generate SSE + # instructions, which need things 16-byte aligned, + # but we don't 16-byte align things. Thus drop + # back to generic i686 compatibility. Trac #2983. + $2="$$2 -march=i686 -m32" + $3="$$3 -march=i686 -m32" ;; x86_64-apple-darwin) $2="$$2 -m64" $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 ]) @@ -962,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], @@ -990,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) ])