[llvm] r251413 - Prefer ranlib mode over ar mode.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 27 10:22:15 PDT 2015


On 27 October 2015 at 09:51, Jonathan Roelofs <jonathan at codesourcery.com> wrote:
>
>
> On 10/27/15 10:37 AM, Ed Schouten via llvm-commits wrote:
>>
>> Author: ed
>> Date: Tue Oct 27 11:37:49 2015
>> New Revision: 251413
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=251413&view=rev
>> Log:
>> Prefer ranlib mode over ar mode.
>>
>> For CloudABI's toolchain I have a symlink that goes from <target>-ar and
>> <target>-ranlib to LLVM's ar binary, to mimick GNU Binutils' naming
>> scheme. The problem is that if we're targetting ARM64, the name of the
>> ranlib executable is aarch64-unknown-cloudabi-ranlib. This already
>> contains the string "ar".
>>
>> Let's move the "ranlib" test above the "ar" test. It's not that likely
>> that we're going to see operating systems or harwdare architectures that
>> are called "ranlib".
>>
>> Reviewed by:    rafael
>> Differential Revision:  http://reviews.llvm.org/D14123
>>
>> Modified:
>>      llvm/trunk/tools/llvm-ar/llvm-ar.cpp
>>
>> Modified: llvm/trunk/tools/llvm-ar/llvm-ar.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ar/llvm-ar.cpp?rev=251413&r1=251412&r2=251413&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/tools/llvm-ar/llvm-ar.cpp (original)
>> +++ llvm/trunk/tools/llvm-ar/llvm-ar.cpp Tue Oct 27 11:37:49 2015
>> @@ -797,9 +797,9 @@ int main(int argc, char **argv) {
>>       "  This program archives bitcode files into single libraries\n"
>>     );
>>
>> -  if (Stem.find("ar") != StringRef::npos)
>> -    return ar_main();
>>     if (Stem.find("ranlib") != StringRef::npos)
>>       return ranlib_main();
>> +  if (Stem.find("ar") != StringRef::npos)
>> +    return ar_main();
>
>
> Shouldn't these all be of the form `Stem.endswith("ar")`?

The problem is if there is a version at the end. That was changed in r193612.

Cheers,
Rafael


More information about the llvm-commits mailing list