[cfe-dev] Building CLANG from Source with GCC and Gold

Samuel Goodrick via cfe-dev cfe-dev at lists.llvm.org
Thu Sep 14 13:30:35 PDT 2017


Hello all,

I am trying to do some work on clang on a Linux system, and the default
linker, ld is requiring far too much memory to link the program. I want to
try using Gold or perhaps LLD, but I have been unable to configure the
CMake files properly to change the Linker.

I have attempted to edit the CMake variables like so:
cmake -DCMAKE_LINKER=/usr/bin/ld.gold
-DCMAKE_CXX_LINK_EXECUTABLE="<CMAKE_LINKER>
<FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET>
<LINK_LIBRARIES>" -G "Unix Makefiles" ../llvm


but was ultimately unsuccessful. I get the error:
/usr/bin/ld.gold: -Werror=date-time: unknown option

so I removed the <FLAGS> option to bypass the this problem, which
results in the error:
/usr/bin/ld.gold: -Wl,-allow-shlib-undefined: unknown option

Has anyone been able to build CLANG with a non-default linker on
Linux? How did you configure your CMake files to do so?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170914/02aa30cd/attachment.html>


More information about the cfe-dev mailing list