summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2016-11-14 14:13:30 -0500
committerBen Gamari <ben@smart-cactus.org>2017-04-20 17:38:44 -0400
commit0f9f1da3d76ccbd1c19a08929f8aa4a8b73cac29 (patch)
treeaf55d855a49e508be5c3d8dcc7a1acd59d23555e
parent2dfae4d5d5c509f09d8e67a52094b3719fd75e8c (diff)
downloadhaskell-ghc-7.10.tar.gz
configure: Verify that GCC recognizes -no-pie flagghc-7.10
It seems like GCC versions prior to 4.8 exit with code 0 when faced with an unrecognized flag. Silly compilers. Test Plan: Validate Reviewers: hvr, austin, ggreif Reviewed By: ggreif Subscribers: thomie, erikd Differential Revision: https://phabricator.haskell.org/D2707 GHC Trac Issues: #12759 (cherry picked from commit 011af2bf448c28db68a55293abaa5b294f170e37)
-rw-r--r--aclocal.m43
1 files changed, 2 insertions, 1 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index b58d18176c..2c69b78480 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1260,7 +1260,8 @@ AC_DEFUN([FP_GCC_SUPPORTS_NO_PIE],
AC_REQUIRE([AC_PROG_CC])
AC_MSG_CHECKING([whether GCC supports -no-pie])
echo 'int main() { return 0; }' > conftest.c
- if ${CC-cc} -o conftest -no-pie conftest.c > /dev/null 2>&1; then
+ # Some GCC versions only warn when passed an unrecognized flag.
+ if $CC -no-pie -x c /dev/null -dM -E > conftest.txt 2>&1 && ! grep -i unrecognized conftest.txt > /dev/null 2>&1; then
CONF_GCC_SUPPORTS_NO_PIE=YES
AC_MSG_RESULT([yes])
else