[PATCH] D38379: Classify llvm-cfi-verify.

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 16 19:55:33 PDT 2017


skatkov added a comment.

In https://reviews.llvm.org/D38379#898719, @hctim wrote:

> In https://reviews.llvm.org/D38379#898339, @skatkov wrote:
>
> > Please note that this patch causes a build failure to me in case of usage -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON.
> >  I'm trying to figure out whether it is my configuration problem or patch problem.
> >
> > Could you please try to run LLVM build with -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON? May be it is reproducible on your side?
>
>
> Hi Serguei,
>
> I can't seem to repro with those two flags on. Is it possible for you to attack your CMakeCache.txt? What commit # are you at please?
>
> Thanks.


Hi Mitch,

I'm on HEAD, so the most fresh version of LLVM trunk.

My current investigation shows the following. The issue is not reproducible on some hosts while is reproducible on many others.
I guess there is a race condition in a build. Specifically,

the unit test requires CFIVerify library be available. When we use -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON the test expects to find the required symbols in LLVM shared library.
In case make check passes (unit test is compiled) I see these symbols in LLVM shared libraries while when test compilation fails there is no these symbols in shared LLVM library.

The difference I see between these cases is that LLVM library is added to global property LLVM_LIBS before or after CFIVerify library.
In case LLVM shared library is added later, cmake knows about CFIVerify and generates dependency betweem LLVM and CFIVerify, so CFIVerify goes to LLVM shared library and compilation of unittest passes.
In case LLVM shared library is added earlier than CFIVerify, cmake does not know about CFIVerify and I've got a failure.

So it seems there is a some race condition of traversing libraries and I do not know why.

I guess that movement of CFIVerify library to lib directory should resolve the issue.

I want to understand how the order of traverse is defined to understand conditions to reproduce the issue.

For a while, does not it make sense to move CFI library to lib directory?


Repository:
  rL LLVM

https://reviews.llvm.org/D38379





More information about the llvm-commits mailing list