diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-10-02 19:02:05 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2021-10-02 19:05:30 -0400 |
commit | 8223abe7500f3e0030fec41a1f56df6fbbe1bf26 (patch) | |
tree | eb70afa0fddb967faad92375d468b61e9612ab93 | |
parent | 67683142f1e0d9f95bc1be0306b676b5d2e4e97f (diff) | |
download | haskell-8223abe7500f3e0030fec41a1f56df6fbbe1bf26.tar.gz |
configure: Fix redundant-argument warning from -no-pie checkwip/fix-nopie-9.0
Modern clang versions are quite picky when it comes to reporting
redundant arguments. In particular, they will warn when -no-pie is
passed when no linking is necessary.
Previously the configure script used a `$CC -Werror -no-pie -E`
invocation to test whether `-no-pie` is necessary. Unfortunately, this
meant that clang would throw a redundant argument warning, causing
configure to conclude that `-no-pie` was not supported. We now rather
use `$CC -Werror -no-pie`, ensuring that linking is necessary and
avoiding this failure mode.
Fixes #20463.
-rw-r--r-- | aclocal.m4 | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/aclocal.m4 b/aclocal.m4 index 0219ea3a61..8c6c9b7062 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1444,7 +1444,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 -Werror -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 conftest.c > 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 |