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

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 2 00:01:09 PDT 2019


mstorsjo added a comment.

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

> I think most people may realize case insensitiveness on file systems is a bad idea.


While this probably can be argued to be true, relying on the opposite (being able to store files that differ only in case, like in the linux kernel) also is best avoided if possible, especially if you're going to build the codebase on some other platform than the target.

> 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.

Not quite - llvm-lib is used as drop-in replacement for MSVC lib.exe, but for MinGW cases (where you normally use binutils tools) you'd use (llvm-)ar for COFF objects as well. (And llvm-ar is used for MachO as well, not only ELF/COFF.)

In D68033#1690064 <https://reviews.llvm.org/D68033#1690064>, @gbreynoo wrote:

> 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.


FWIW, this particular host platform specific behaviour should in practice be minimal. If possible, llvm-ar inspects the input object files (or existing archive) and decides the default format based on that. The effect is that you get a darwin-style static library if you run llvm-ar on darwin, only if you create a new empty archive where there's no object files to decide from.

Regarding this patch, I'm ok with it (concept-wise, I haven't checked the implementation yet), as building code which relies on distinguishing between filenames that only differ in case, on windows, already in itself is problematic. And as there's predecent for it in GNU binutils (which can be used for cross compiling to ELF platforms, from windows), I think we should do this.


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

https://reviews.llvm.org/D68033





More information about the llvm-commits mailing list