[LLVMdev] LLD dynamic compilation

Renato Golin renato.golin at linaro.org
Mon Jun 30 02:29:13 PDT 2014


Folks,

I'm having a look at LLD and I need some guidance...

I know it's not production ready for x86 and ARM (the idea is to make
it so). My steps:

I've added it to tools/lld and ran CMake again (on x86_64) on a
standard release build (static linking). It works, builds but I see
one unit test error:

Note: Google Test filter = InputGraphTest.Observer
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from InputGraphTest
[ RUN      ] InputGraphTest.Observer
0  DriverTests     0x0000000000498f42
1  DriverTests     0x0000000000498c24
2  libpthread.so.0 0x00007f0ecbf7f4b0
3  DriverTests     0x0000000000462f6a
4  DriverTests     0x00000000005bc3a4
5  DriverTests     0x000000000046bb6f
6  DriverTests     0x0000000000478eea
7  DriverTests     0x0000000000479f58
8  DriverTests     0x000000000047a025
9  DriverTests     0x000000000047e5d0
10 DriverTests     0x000000000047e882
11 DriverTests     0x0000000000411656
12 libc.so.6       0x00007f0ecb1a3000 __libc_start_main + 240
13 DriverTests     0x00000000004169a7

When trying to investigate, I then ran CMake on my debug build (that
has dynamic linking to avoid re-linking of huge libraries during
development cycle), and I got this:

CMake Error: The inter-target dependency graph contains the following
strongly connected component (cycle):
  "lldPasses" of type SHARED_LIBRARY
    depends on "lldNative" (weak)
    depends on "lldYAML" (weak)
  "lldNative" of type SHARED_LIBRARY
    depends on "lldYAML" (weak)
    depends on "lldPasses" (weak)
  "lldYAML" of type SHARED_LIBRARY
    depends on "lldNative" (weak)
    depends on "lldPasses" (weak)
At least one of these targets is not a STATIC_LIBRARY.  Cyclic
dependencies are allowed only among static libraries.

The error is clear, and the only way (I know) to make it compile
dynamically is to remove the cyclic dependency.

Question is: Why the cyclic dependency? Is that really necessary, or
is that no one ever bothered?

cheers,
--renato



More information about the llvm-dev mailing list