[PATCH] D113130: [llvm-libtool-darwin] Throw an error if object file names are repeated
Shoaib Meenai via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 8 09:51:38 PST 2021
smeenai added a comment.
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).
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