[PATCH] D142484: [LinkerWrapper] Only import static libraries with needed symbols

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 24 10:36:30 PST 2023


tra added inline comments.


================
Comment at: clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp:1217-1218
+///   1) It defines an undefined symbol in a regular object filie.
+///   2) It defines a global symbol without hidden visibility that has not
+///      yet been defined.
+Expected<bool> getSymbols(StringRef Image, StringSaver &Saver,
----------------
jhuber6 wrote:
> tra wrote:
> > How do we handle conflicting symbols defined more than once? 
> > 
> I just assume that will be caught by the actual linker, it's not relevant for knowing which symbols to pull out.
That would be the case when we were loading all libraries at once.
However, now that we load them as needed one by one, we may end up loading only the first file which provides such symbol and would potentially ignore others, if no other symbol requires loading them. Given that we're checking the symbols anyways, it would be useful to diagnose it, IMO.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142484



More information about the cfe-commits mailing list