[PATCH] Proper whole-archive handling

Rui Ueyama ruiu at google.com
Mon Sep 9 11:41:17 PDT 2013


--force_load seems to be an equivalent to --whole-archive, but I just found
that the field you just added is not really used at all.

Did you forget to add the following code to use the field?

--- a/lib/Driver/DarwinLdDriver.cpp
+++ b/lib/Driver/DarwinLdDriver.cpp
@@ -75,7 +75,7 @@ MachOFileNode::createLinkerInput(const LinkingContext
&ctx) {
   auto inputFile(FileNode::createLinkerInput(ctx));

   if (inputFile)
-    (*inputFile)->setWholeArchive(false);
+    (*inputFile)->setWholeArchive(_isWholeArchive);
   return std::move(inputFile);
 }



On Mon, Sep 9, 2013 at 11:33 AM, Joerg Sonnenberger <joerg at britannica.bec.de
> wrote:

> On Mon, Sep 09, 2013 at 11:28:44AM -0700, Rui Ueyama wrote:
> >
> >
> > ================
> > Comment at: include/lld/Driver/DarwinInputGraph.h:52
> > @@ -48,2 +51,3 @@
> >    const MachOLinkingContext &_ctx;
> > +  bool _isWholeArchive;
> >  };
> > ----------------
> > This change caused the compiler to warn if -Wunused-private-field is
> enabled. I'm going to remove this  line for now for those who enabled
> -Werror.
>
> Doesn't Darwin have an equivalent to --whole-archive? -force_load or so
> with corresponding no option?
>
> Joerg
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130909/d8c3ddf0/attachment.html>


More information about the llvm-commits mailing list