summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-11-21 14:27:11 -0500
committerBen Gamari <ben@smart-cactus.org>2017-11-21 14:27:12 -0500
commit66d17995a057c313fb22b0660a6327bd41afea4a (patch)
tree7b98ebc238126c0233124b1ab11840051a2b5ab7 /aclocal.m4
parentd213ee8766aeba2d2add5390d46bdcdc42c5dd51 (diff)
downloadhaskell-66d17995a057c313fb22b0660a6327bd41afea4a.tar.gz
configure: Fix ar probed flags
FP_PROG_AR_ARGS appears to be probing for what flags to use to build an archive with an index. However, none of the flags that it probed previously were valid as they all started with `c`, which isn't a mode character. This went unnoticed until someone attempted to use LLVM ar since we have a special case for gnu ar. Additionally, we work around a bug in llvm-ar 5.0 where ar will exit with code 0 even if it fails to parse the command line. Silliness. I believe these should rather all be mode `q` however I'll need to test this on a few platforms to be certain. Test Plan: Validate on OS X, BSD, and Linux with binutils and llvm ar Reviewers: hvr Subscribers: rwbarton, thomie, erikd Differential Revision: https://phabricator.haskell.org/D4214
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m412
1 files changed, 8 insertions, 4 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index c77c8de4cc..5dc618df8a 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1153,11 +1153,15 @@ if test $fp_prog_ar_is_gnu = yes; then
fp_cv_prog_ar_args="q"
else
touch conftest.dummy
- for fp_var in clqsZ clqs cqs clq cq ; do
+ for fp_var in qclsZ qcls qcs qcl qc ; do
rm -f conftest.a
- if "$fp_prog_ar" $fp_var conftest.a conftest.dummy > /dev/null 2> /dev/null; then
- fp_cv_prog_ar_args=$fp_var
- break
+ if "$fp_prog_ar" $fp_var conftest.a conftest.dummy > /dev/null 2> /dev/null ; then
+ # Also check that a result was created; it seems some llvm-ar versions
+ # exit with code zero even if they fail to parse the command line.
+ if test -f conftest.a ; then
+ fp_cv_prog_ar_args=$fp_var
+ break
+ fi
fi
done
rm -f conftest*