Commit 66d17995 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

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
parent d213ee87
...@@ -1153,11 +1153,15 @@ if test $fp_prog_ar_is_gnu = yes; then ...@@ -1153,11 +1153,15 @@ if test $fp_prog_ar_is_gnu = yes; then
fp_cv_prog_ar_args="q" fp_cv_prog_ar_args="q"
else else
touch conftest.dummy 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 rm -f conftest.a
if "$fp_prog_ar" $fp_var conftest.a conftest.dummy > /dev/null 2> /dev/null; then if "$fp_prog_ar" $fp_var conftest.a conftest.dummy > /dev/null 2> /dev/null ; then
fp_cv_prog_ar_args=$fp_var # Also check that a result was created; it seems some llvm-ar versions
break # 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 fi
done done
rm -f conftest* rm -f conftest*
......
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