[PATCH] D22356: [ThinLTO] Perform conservative weak/linkonce resolution in distributed backend case

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 19 06:17:47 PDT 2016


tejohnson abandoned this revision.
tejohnson added a comment.

In https://reviews.llvm.org/D22356#487953, @mehdi_amini wrote:

> > > The reason is that the first link is performing linker resolution: this decision process carry some specific semantic with archives. After this resolution and the ThinLTO process, there is no reason that makes sense to me right now to repeat this process.
>
> > 
>
> > 
>
> > But it shouldn't be a correctness issue to do so.
>
>
> Cf answer to David by email.


Yes, as responded there that is a compelling example for doing this via the build system. Abandoning this revision while I work on that solution.

> 

> 

> > > Also, the distributed build system probably needs to handle the case where an object in the archive was not selected to be part of the link at all, won't be processed by ThinLTO, and there won't be any object to pass to the final link. I'm not sure how you're handling this with gold right now though.

> 

> > 

> 

> > 

> 

> > The gold plugin processes all the bitcode files, and gold simply tells it which symbols will be prevailing and which are preempted. So there is always a resulting object file to pass to the final link.

> 

> 

> I don't have gold to verify, but can you confirm what happens with:

> 

>   A.cpp:

>   int main() {}

>   B.cpp:

>   void foo() {}

> 

> 

> when built with:

> 

>   clang -c -flto -c A.cpp B.cpp

>   clang -flto A.o --start-lib B.o --end-lib -Wl,-save-temps

> 

> 

> (Not sure what is the right options to save the LTO bitcode file).

> 

> Will B.o be sent to LTO? Will it be merged with A.o?

>  Similarly, repeating the process with ThinLTO, will B.o be part of the index? (That'd be a semantic break).


Previously it was including B.o in the index (with the old binutils I have installed I see that behavior). However, eugenis recently fixed this for the LTO side, via a new callback in gold and support in gold-plugin to skip the resulting files (see https://reviews.llvm.org/rL262676). And I can see that with his changes to the plugin this should avoid putting B.o in the index (will update my binutils shortly to confirm).


https://reviews.llvm.org/D22356





More information about the llvm-commits mailing list