[PATCH] D68033: [llvm-ar] Make paths case insensitive when on windows

Owen Reynolds via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 1 11:08:44 PDT 2019


gbreynoo added a comment.

In D68033#1689605 <https://reviews.llvm.org/D68033#1689605>, @MaskRay wrote:

> I asked because I want to make sure this patch is put up for practical use, not for a compatibility corner case that may rarely matter. I think most people may realize case insensitiveness on file systems is a bad idea. If my understanding is correct, llvm-lib used by Windows. llvm-ar is an ELF tool and it should match a generic ELF platform as close as possible and such platform disparity should be as little as possible.


Thanks for the quick response. I agree that case insensitiveness on file systems is a bad idea, however the reality is that Windows has case a case insensitive file system (at least by default) . To be clear our customers will always be using llvm-ar on a Windows host along side the other ELF tools they are using to cross compile to another target. The case I outlined above could occur due to human error or presumption that the Windows path semantics would extend not just to when accessing the file system but when manipulating those members.

llvm-ar normalises relative paths in order to properly compare them rather than using a naive string comparison. This is due to thin archive members representing file paths, and as such different paths can point to the same file. In the case of Windows this also applies to paths of different cases, in the case above those paths represent the same file in the Windows file system and I think llvm-ar should treat them as such.

Also llvm-ar already differs in behaviour depending on host platform, the main one being the default format of a newly created archive. I don't think this behaviour difference would surprise anyone using a Windows machine, particularly if they have used ar on Windows in the past which we know follows this behaviour.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68033/new/

https://reviews.llvm.org/D68033





More information about the llvm-commits mailing list