[PATCH] D113130: [llvm-libtool-darwin] Throw an error if object file names are repeated
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 9 00:18:28 PST 2021
jhenderson added a comment.
In D113130#3115989 <https://reviews.llvm.org/D113130#3115989>, @smeenai wrote:
> This change was motivated by an issue observed internally where llvm-libtool silently accepting two input files with the same basename and putting them into the same archive led to a crash. This was ultimately down to an ODR violation on our end, but we noticed that cctools' libtool gives a warning in the same scenario, which at least gives the user some hint of what might be going on.
>
> We originally thought of an emitting an error instead of a warning because we couldn't think of a good reason you'd want two files with the same basename in the same archive (it also results in confusing linker diagnostics, `ar` extractions, etc.), and because warnings are super easy to miss in build output. However, there might be cases where this situation arises naturally (especially with third-party archives out of your control), so matching cctools behavior and emitting a warning instead of an error does make more sense (and we could always add an option to upgrade the warning to an error if we desired).
Thanks fo the explanation, it makes sense to me.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113130/new/
https://reviews.llvm.org/D113130
More information about the llvm-commits
mailing list