[PATCH] D116913: [lld-macho] Add --start-lib --end-lib

Vy Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 12 16:25:52 PST 2022


oontvoo added inline comments.


================
Comment at: lld/MachO/Driver.cpp:250
 static DenseMap<StringRef, ArchiveFile *> loadedArchives;
+static bool inLib;
 
----------------
can this be a parameter to the addFile() function instead?

Having it as a global makes it harder to introduce any kind parallelization in processing the input (which i'm working on a POC for,  since lld-macho is currently proven to be too slow to link Youtube)

Also I've said this on the bug but I'm kind concerned about introducing stateful flags like this given there's no precedence for it in LD64.


================
Comment at: lld/MachO/UnwindInfoSection.cpp:229
           if (Symbol *sym = symtab->find(defined->getName()))
-            if (sym->kind() != Symbol::LazyArchiveKind)
+            if (!sym->isLazy())
               r.referent = s = sym;
----------------
MaskRay wrote:
> @oontvoo This change does not make the new test in `lld/test/MachO/objc-uses-custom-personality.s` work. Do you know why?
I think this is because this new lazyobject, as currently implemented, is slightly different from an archive in that objc symbols in archives are pulled in "eagerly" if the `-ObjC` flag is present. (This is a necessary condition for this test because it needs `_OBJC_CLASS_$_MyTest`, which would then pull in the personality symbol).

There's no golden standard to look to here given LD64 doesn't have this, but I guess we should try to make it behave similarly to archives when it comes to objc handling.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116913



More information about the llvm-commits mailing list