Index: llvm/tools/llvm-ar/llvm-ar.cpp =================================================================== --- llvm/tools/llvm-ar/llvm-ar.cpp +++ llvm/tools/llvm-ar/llvm-ar.cpp @@ -1179,16 +1179,16 @@ llvm::InitializeAllAsmParsers(); Stem = sys::path::stem(ToolName); - if (Stem.contains_lower("dlltool")) + if (Stem.endswith("dlltool") || Stem.contains("dlltool-")) return dlltoolDriverMain(makeArrayRef(argv, argc)); - if (Stem.contains_lower("ranlib")) + if (Stem.endswith("ranlib") || Stem.contains("ranlib-")) return ranlib_main(argc, argv); - if (Stem.contains_lower("lib")) + if (Stem.endswith("lib") || Stem.contains("lib-")) return libDriverMain(makeArrayRef(argv, argc)); - if (Stem.contains_lower("ar")) + if (Stem.endswith("ar") || Stem.contains("ar-")) return ar_main(argc, argv); fail("not ranlib, ar, lib or dlltool"); }