[commit: ghc] master: configure: Use -Werror to check for existence of -no-pie (cbd73bb)
git at git.haskell.org
git at git.haskell.org
Thu Apr 19 22:57:23 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/cbd73bbbb7df080d5204098aa02e5f5d0d48823c/ghc
>---------------------------------------------------------------
commit cbd73bbbb7df080d5204098aa02e5f5d0d48823c
Author: Ben Gamari <bgamari.foss at gmail.com>
Date: Thu Apr 19 15:05:50 2018 -0400
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
>---------------------------------------------------------------
cbd73bbbb7df080d5204098aa02e5f5d0d48823c
aclocal.m4 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/aclocal.m4 b/aclocal.m4
index a48a5af..1cef842 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -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
More information about the ghc-commits
mailing list