I am building LLVM 6 on Ubuntu 16.04. I want lld
too. But no matter what I do, lld
doesn't build/install.
Followed the following instruction from here. Still sifting through first and second :)
Read the documentation.
Read the documentation.
Remember that you were warned twice about reading the documentation.
In particular, the relative paths specified are important.
Checkout LLVM:
cd where-you-want-llvm-to-live svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
Checkout Clang:
cd where-you-want-llvm-to-live cd llvm/tools svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
Checkout Extra Clang Tools [Optional]:
cd where-you-want-llvm-to-live cd llvm/tools/clang/tools svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
Checkout LLD linker [Optional]:
cd where-you-want-llvm-to-live cd llvm/tools svn co http://llvm.org/svn/llvm-project/lld/trunk lld
Didn't download the other optional packages. Since svn
download was not working properly (svn: E000104: Error running context: Connection reset by peer
), I downloaded respective zip
for LLVM, Clang, clang-extra and lld from their github mirrors. Since, I didn't use svn
some renaming of the folders had to be done (for e.g. clang-tools-extra-master
to just extra
).
Then execute the following, after cd
ing into the parent folder of the llvm
source folder,
$ mkdir build; cd build
$ cmake ../llvm
$ make
After waiting for +8 hours, I get all the programs (clang
, lli
, llc
etc.) except lld
. I am expecting it to appear in the folder build/bin
.
I have also tried the option cmake -DLLVM_ENABLE_PROJECTS=llvm/tools/lld ../llvm
. (The form -DLLVM_ENABLE_PROJECTS=lld
doesn't work and I found this place discussing about the same ENABLE issue.)
I have already tried things with some tweaking three times. Since it takes so much time to compile, I decided to take your help.
A separate issue: While building, linking phase takes 12 GB RAM + 8.8 GB swap space on my laptop!! Does LLVM building really require >20 GB of ram ? (I had closed all other foreground apps, especially firefox
)
Please let me know if any more information is needed.