Skip to content

Commit

Permalink
configure: Verify that GCC recognizes -no-pie flag
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bgamari committed Nov 14, 2016
1 parent cb16890 commit 011af2b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,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
Expand Down

0 comments on commit 011af2b

Please sign in to comment.