[llvm-dev] CMake vs. autotools output differences

Andrew Wilkins via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 27 05:58:53 PDT 2015


I've spent some time hacking up the Debian packaging to use CMake instead
of autotools; it's still a work in progress, but it works. It's a bit of a
mess, though, primarily because there are differences in the output of the
CMake and autotools builds.

On my Ubuntu machine, the dependencies for clang-3.6 look like this:
$ ldd /usr/bin/clang-3.6
        linux-vdso.so.1 =>  (0x00007ffc7af57000)
        libLLVM-3.6.so.1 => /usr/lib/x86_64-linux-gnu/libLLVM-3.6.so.1
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe47dfb6000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fe47dd9b000)
        libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6
        libedit.so.2 => /usr/lib/x86_64-linux-gnu/libedit.so.2
        libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe47d52c000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe47d224000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fe480aa5000)

Using CMake with BUILD_SHARED_LIBS, it looks like this:
(the fact that I used pastebin is a hint)

The main difference is the many LLVM/Clang shared library dependencies,
rather than just one. It's preferred that each shared library is packaged
separately, but this would be a bit of a maintenance nightmare; so that
would mean one package with many shared libraries in it (more likely, one
for all clang shared libraries, and one for all LLVM).

Are the differences between them intentional? Is there any room for change
-- to have the CMake-build tools link against the monolithic libLLVM as in

Second, Debian packages want both shared objects and static archives.
BUILD_SHARED_LIBS means one or the other. Is there any reason why it would
be a bad idea to modify add_llvm_library to create targets for both static
and shared, if not specified?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150827/61ff5e18/attachment.html>

More information about the llvm-dev mailing list