[英]Is it possible to compile & link Clang/LLVM using the gold linker?
I'm writing a custom pass for LLVM/Clang, and recompiling tends to take a while and use a lot of memory. 我正在为LLVM / Clang编写自定义传递,重新编译往往需要一段时间并使用大量内存。 I've heard that the gold linker (1) takes less time and (2) uses less memory than the standard ld linker.
我听说黄金链接器(1)花费的时间更少,(2)使用的内存比标准的ld链接器少。
Is there a way to pass flags into the LLVM/Clang build process and change to the gold linker? 有没有办法将标志传递到LLVM / Clang构建过程并更改为黄金链接器? As per this answer , I've been attempting to use an override file, but I don't seem to be having a lot of success.
根据这个答案 ,我一直在尝试使用覆盖文件,但我似乎没有取得很大的成功。
I'll also note that I'm compiling the latest Clang/LLVM build (4.0) using Clang 3.9; 我还要注意到我正在使用Clang 3.9编译最新的Clang / LLVM版本(4.0); I don't mind switching back to GCC if necessary but would rather avoid it.
如果有必要,我不介意切换回GCC,而是宁愿避免它。
Post-4.0 (after commit rL292047 ), you should set LLVM_USE_LINKER
to gold
like so: 4.0之后(在提交rL292047之后 ),您应该将
LLVM_USE_LINKER
设置为gold
如下所示:
cmake ... -DLLVM_USE_LINKER=gold ...
Refer to http://llvm.org/docs/CMake.html#llvm-specific-variables 请参阅http://llvm.org/docs/CMake.html#llvm-specific-variables
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.