This is an archive of the discontinued LLVM Phabricator instance.

[lld] Revive standalone CMake build
AbandonedPublic

Authored by garious on Feb 13 2015, 2:17 PM.

Details

Summary

A little while back we boot the standalone CMake build because it was broken, overly-complex and we found that nobody was really using it. I'd like to bring it back because it makes working with the sanitizers especially fast and easy. Some sanitizers, such as ASan, don't require dependencies to be instrumented. By leaving the LLVM libraries uninstrumented and optimized, we can build just lld with instrumentation and debug symbols, and get a blazing fast sanitizer build.

This patch reintroduces the standalone build in a cleaner way than before. The code to support the standalone build is itself standalone, nicely tucked under one conditional. It's purpose is to put the build into the same context as if the LLVM build included it. This patch also adds a config file for the one #define lld depends on, so that we don't have to reach into LLVM's private build directory for its config.h.

Diff Detail

Repository
rL LLVM

Event Timeline

garious updated this revision to Diff 19929.Feb 13 2015, 2:17 PM
garious retitled this revision from to [lld] Revive standalone CMake build.
garious updated this object.
garious edited the test plan for this revision. (Show Details)
garious set the repository for this revision to rL LLVM.
garious added a project: lld.
garious added a subscriber: Unknown Object (MLST).
shankarke added inline comments.
cmake/config-ix.cmake
6

why is this being reimplemented ?

garious added inline comments.Feb 13 2015, 3:21 PM
cmake/config-ix.cmake
6

Because the LLVM install directory does not offer this functionality.

shankarke added inline comments.Feb 13 2015, 3:26 PM
CMakeLists.txt
54

Does other projects too have a standalone build, I thought it was completely removed. If this is being revived should this be done for all projects ?

Please wait for Bigcheese / Nick whether we want to bring this in.

cmake/config-ix.cmake
6

should this be then added to the LLVM install directory then ? we need to keep mirroring these changes from llvm if there is a change, I think it woul d be hard to maintain.

garious added inline comments.Feb 13 2015, 3:48 PM
CMakeLists.txt
54

Yes, all other llvm projects have a standalone CMake builds.

cmake/config-ix.cmake
6

I have no strong opinion on this. I see your point, but also think the LLVM repo should minimize its public interface. My preference is to hold off on adding this to LLVM's install directory until the duplication causes a little pain. I can imagine this particular code living a long time without causing any.

Can others please review? Thanks.

Still waiting on a second review. @Bigcheese, @nicholas?

chandlerc edited edge metadata.Feb 23 2015, 11:09 AM

My position remains that this isn't really that useful or worth the
maintenance burden that it brings. But I'm not really one of the primary
developers on LLD. I've just not had any trouble just enabling sanitizers
in the LLVM build to check LLD, nor have I heard complaints about this from
others.

That's why I'm silent here. If the LLD developers really want this, they
would probably show up and review it. My guess is that it doesn't solve an
important problem for them, but I can only speculate.

garious abandoned this revision.Feb 24 2015, 1:26 PM

Seems I'm the only one that wants this, abandoning. That's too bad. Standalone builds are really nice in component-oriented builds, especially when managing multiple build variations. Unfortunately, all my code that demonstrates this is locked inside our company. Oh well - perhaps another day.