Currently, tool discovery checks for a tool with its target triple as a
prefix. Unfortunately, the triple it uses is canonicalized, and may
contain the Android platform numbers as a suffix. This prevents matching
of the binaries in the LLVM bin directory of the Android NDK.
This CL adds checks during discovery that will match the canonical
Android NDK triples. The matcher will work with vendor "unknown", and at
any level platform.
Adding the hardcoding here seems unfortunate. We have some code like this already in other places. It may be better to reuse the same logic. In particular, I'd expect we want to find program-prefixed names the same way as we did paths.
That seems to be done here https://github.com/llvm/llvm-project/blob/b6598bcf4b81ed8fb66a7c576a81e422750b9329/clang/lib/Driver/ToolChains/Linux.cpp#L236
While this function doesn't currently provide for a list of prefixes to be input, adding such a mechanism, and then having the code referenced above above add the prefix to the list, would seem better.