Commit cbd73bbb authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

configure: Use -Werror to check for existence of -no-pie

Clang throws a warning instead of an error when it is passed -no-pie,

    clang: warning: argument unused during compilation: '-nopie'
    [-Wunused-command-line-argument]

Consequently configure concludes that it supports -no-pie. However, this
will fail when used with -Werror. The solution is to simply use -Werror
in the configure check.

Thanks to @goldfire for reporting this.

Reviewers: hvr

Subscribers: thomie, carter, goldfire

Differential Revision: https://phabricator.haskell.org/D4557
parent 3c3e7310
......@@ -1294,7 +1294,7 @@ AC_DEFUN([FP_GCC_SUPPORTS_NO_PIE],
AC_MSG_CHECKING([whether GCC supports -no-pie])
echo 'int main() { return 0; }' > conftest.c
# 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
if $CC -no-pie -Werror -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
......
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