[PATCH] D106179: [lld-macho] Disambiguate bitcode files with the same name by archive name/offset in archive

Leonard Grey via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 22 13:07:48 PDT 2021


lgrey added inline comments.


================
Comment at: lld/MachO/InputFiles.cpp:1263
+  // ThinLTO assumes that all MemoryBufferRefs given to it have a unique
+  // name. If two archives (or a single thin archive) define two members with
+  // the same name, this causes a collision and ThinLTO can't proceed.
----------------
thakis wrote:
> It doesn't have to be a thin archive, regular archives can contain several files with the same name:
> 
> ```
> % echo 'void a() {}' > a.cc
> % echo 'void b() {}' > b.cc
> % mkdir a
> % mkdir b
> % clang -flto=thin -c a.cc -o a/a.o
> % clang -flto=thin -c b.cc -o b/a.o
> % ar -t libfoo.a
> __.SYMDEF
> a.o
> a.o
> ```
Reworded


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

https://reviews.llvm.org/D106179



More information about the llvm-commits mailing list